On Mar 26, 3:16=A0am, sf94...@[EMAIL PROTECTED]
wrote:
>
> Since the retrieval process isn't very refined, I'm stuck with log
> output that spans several minutes, but I'm only interested in the
> output from the past minute (date +%H:%M --date "1 minute ago"). =A0I've
> tried to write a small awk process that would go through the log file
> every 5 minutes and capture the output from the past minute and write
> it out to individual log files locally.
>
This might be a start for your awk script:
BEGIN { past_minute =3D strftime("%F %H:%M",systime()-60) }
/^=3D=3D>/ { file_name =3D $2 ; gsub("/","_",file_name) }
substr($0,1,16) =3D=3D past_minute {
# Some logic if you want to print
# or ignore the following lines
# ...
print >> file_name
}


|