Re: yamp yet another multiline post




eeb4u@xxxxxxxxxxx wrote:
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

Under Solaris, always use /usr/xpg4/bin/awk. I believe
the other awks are old and obsolete.

.



Relevant Pages

  • Re: yamp yet another multiline post
    ... start app timestamp ... return string from application ... app complete timestamp ... Mike Dundas ...
    (comp.lang.awk)
  • yamp yet another multiline post
    ... I need to clean up a log file that was produced when the logging level set ... start app timestamp ... return string from application ... app complete timestamp ...
    (comp.lang.awk)
  • Re: yamp yet another multiline post
    ... Mike Dundas wrote: ... start app timestamp ... return string from application ... app complete timestamp ...
    (comp.lang.awk)
  • Re: Timestamp Value - please help
    ... The following topic in MSDN gives an example of converting hex to string. ... Private mintEmpID As Integer ... 'Pass the timestamp to conversion function. ... I retrieve the updated TS for future updates. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: [PhP - dB] About Formatting a Date Result
    ... In the MySQL database the field is set to date not timestamp as you ... foresight has stored a string date instead of a timestamp, ... and can format your date to that used, in the config files, for any user ...
    (php.general)