Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get next line 1

Status
Not open for further replies.
Apr 13, 2004
316
US
This should be my last question regarding awk.

If my file contains lines such as:

Variable Name: IBM.PSSP.VSDdrv.timeout_error
Value Type: Counter
Data Type: long
Initial Value: 0
Class: IBM.PSSP.VSD
Locator: NodeNum
Variable Description:
The number of timeouts.

The VSD driver keeps a timer and retry count for every remote request.
When the timer expires for a request that has not completed, the
request will be retried if the retry count is not exhausted. When the
retry count is exhausted, then the Timeouts counter is incremented
and the request is unsuccessful.

This variable is supplied by the "IBM.PSSP.harmld" resource monitor.

Example: To be informed whenever a timeout occurs, one could register
for an event with the designations that follow:

Resource Variable Name: IBM.PSSP.VSDdrv.timeout_error
Resource ID: NodeNum=*
Expression: X@R > X@PR

Resource ID wildcarding:

The "NodeNum" resource ID element may be wildcarded to apply

I want to get "NodeNum" or whatever the "Resource ID" is after I find the "Resource Variable Name" I am looking for. There are over 500 resource variables, but the resource ID is the line that follows the variable name.

Thanks again!
 
Put this in file named findnode.awk:
[tt]
/^Resource Variable Name:/ {
if ( index( $0, sought ) )
{ getline s
print s
}
}
[/tt]
Invoke with
awk -f findnode.awk sought="IBM.PSSP.VSDdrv.timeout_error" data.txt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top