Re: yamp yet another multiline post
- From: "eeb4u@xxxxxxxxxxx" <eeb4u@xxxxxxxxxxx>
- Date: 17 Feb 2006 13:38:04 -0800
William James wrote:
Mike Dundas wrote:
I need to clean up a log file that was produced when the logging level set
too high
logfile has following format:
*******************
start app timestamp
return string from application
app complete timestamp
*******************
start app timestamp
return string from application
app complete timestamp
Above are two complete records. Normally 6 lines per record, one
start-of-record line with 19 asterisks, two are blank lines, two timestamps
and a one line return string if application found no data to process. If
data was available for processing, return string would possibly be up to 10
lines in length. Return string does have a unique word in it that would not
be present in any of the 10 lines that may be written if data were available
for processing.
It would have helped if you had mentioned that word.
I would like to remove the entries from the log file that didn't show any
data processing. e.g. the above two entries would be removed.
using solaris 10 awk, or /usr/xpg4/bin/awk. Incidentally, am I better
moving solaris awk to awk.old and linking xpg4 awk instead?
Thanks for your help,
Mike Dundas
{ text = text $0 "\n" ; count++ }
!NF && count > 2 {
if ( text !~ /unique word/ )
printf "%s", text
text = count = ""
}
The word in question was "cpu". I will try your posted solution
tonight.
thanks,
Mike Dundas
.
- Follow-Ups:
- Re: yamp yet another multiline post
- From: William James
- Re: yamp yet another multiline post
- References:
- yamp yet another multiline post
- From: Mike Dundas
- Re: yamp yet another multiline post
- From: William James
- yamp yet another multiline post
- Prev by Date: Re: yamp yet another multiline post
- Next by Date: Re: yamp yet another multiline post
- Previous by thread: Re: yamp yet another multiline post
- Next by thread: Re: yamp yet another multiline post
- Index(es):
Relevant Pages
|