- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Turn a report into one line per record with aw...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2005 07:44 AM
тАО08-19-2005 07:44 AM
This is the output from syminq -clar -v. It produces some 15 lines for every LUN presented to this server:
Device Physical Name : /dev/rdsk/c101t5d3
Device Serial ID : Ch2 CONT
Vendor ID : DGC
Product ID : CX700WDR5
Product Revision : HP03
Peripheral Device Type : Direct Access
Controller Number : 65
Target ID : 5
Logical Unit Number : 3
Capacity (in KB) : 8838720
Clariion ID : APM00052802175
Device Clariion Name : 0117
Device State : ASSIGNED
Device WWN : 60:06:01:60:90:84:15:00:5C:B1:65:C1:AC:10:DA:11
Powerpath Device Type : CHILD
VxVM DMP Device Type : N/A
Device Physical Name : /dev/rdsk/c101t5d4
Device Serial ID : Ch2 CONT
Vendor ID : DGC
Product ID : CX700WDR5
Product Revision : HP03
Peripheral Device Type : Direct Access
Controller Number : 65
Target ID : 5
Logical Unit Number : 4
Capacity (in KB) : 70709760
Clariion ID : APM00052802175
Device Clariion Name : 0116
Device State : ASSIGNED
Device WWN : 60:06:01:60:90:84:15:00:FC:B4:A8:13:AC:10:DA:11
Powerpath Device Type : CHILD
VxVM DMP Device Type : N/A
I would like to turn this into one line per LUN, like this:
Dev Type GB Array LuN
c101t5d3 CX700WDR5 7079760 APM..2175 0116
But I cant' figure out how to do it.
I tried:
awk '{RS="Device Physical Name"; print $3, $9...}'
but it's not working..
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2005 07:57 AM
тАО08-19-2005 07:57 AM
Re: Turn a report into one line per record with awk ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2005 11:15 AM
тАО08-19-2005 11:15 AM
Solutionawk '{/Device Phy/ {ctd=$5;next}
/Product ID/ {prodid=$4;next}
/Capacity/ {kb=$5;next}
/VxVM/ {print ctd, prodid, kb/1000}'
I'm guessing the fields.
Marlou
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-19-2005 04:13 PM
тАО08-19-2005 04:13 PM
Re: Turn a report into one line per record with awk ?
Marlou outlines the classic and recommended solution, specially if you are goinf to be selecting specific fields, adn possibly re-ordering the output.
Now if the problem is simple "I would like to turn this into one line per LUN" then the answer would be:
awk -F" : " '{if (NF>1){ line = line " " $2}}/^VxVM/{print line; line = ""}' x
. make " : " the field seperator.
. if more than 1 field in the input then add field 2 to variable 'line'.
. if input starts with VxVM then print the line variable and clear it.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-20-2005 02:43 AM
тАО08-20-2005 02:43 AM
Re: Turn a report into one line per record with awk ?
If the string with VxVM DMP Device Type is the last in the output, try this:
awk 'NF<2{next}
/VxVM DMP Device Type/ {print $NF;next}
{printf("%s ",$NF}'
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-22-2005 03:35 AM
тАО08-22-2005 03:35 AM