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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing log file 2

Status
Not open for further replies.

savoche

Technical User
May 5, 2010
3
NO
Hi!

I've got a log file to parse. What I need is to extract the Node Name where Status is "Missed". The thing that trips me is that the Node Name may or may not be divided over 2 lines. When divided, the first part always ends with a dash (which we want to get rid of, obviously). All lines are 79 cols wide:

BOF
[tt]

Scheduled Start Actual Start Schedule Name Node Name Status
-------------------- -------------------- ------------- ------------- ---------
03.05.2010 21:00:00 DAILY_INCR_L- EXAMPL-WEB01- Missed
INUX .EXAMPLE.COM
03.05.2010 21:00:00 DAILY_WIN01 SERVER03-EXA- Missed
MPLE.COM
03.05.2010 23:15:00 03.05.2010 23:15:20 DAILY_INCR-L- SERVR01.EXAM- Failed 12
INUX PLE.COM
03.05.2010 23:15:00 03.05.2010 23:15:31 DAILY_WIN01 WRK-EHI02 Missed
03.05.2010 23:15:00 DAILY_INCR_W- SERVER02 Missed
IN02
[/tt]
EOF

Any suggestions?
 
Not an answer to your question, but...

How is this log file produced? Can you run the same TSM command that produces it with the option [tt]-displaymode=list[/tt] or even [tt]-commadelimited[/tt] to get the output in a more uniform format?

HTH,

p5wizard
 
Thanks p5wizard,

I'll have to check and see if something else will break if I change the format :)
 
A starting point:
Code:
awk '/Missed/{n=$(NF-1);if(n~/-$/){getline;sub(/-$/,$NF,n)};print n}' file.log

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV!

I think I even understand how it works :)

Thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top