No, it was I. I went too fast while looking at your use of $last/last; - sorry ! But now he has choices :)
As to the OP assuming that there will always be a match ... yep, better test for that! And what if the log is being written by a daemon that is getting input from multiple threads? I've had logs with entries that weren't chronological, even from apache, and until you parse and sort the entries you can't guarantee they are in order ... so the "flag" approach you and I offered would miss any entries that were separate from the group by a non-matching one ... and so it goes :-)
That's why it's unfortunate that so many of the newbs seem to be interested only in having $it work rather than learning tools to get $it or $unknown_future_thing to work.
In reply to Re^4: Store log file content from EOF till final occurrence of timestamp
by 1nickt
in thread Store log file content from EOF till final occurrence of timestamp
by jayu_rao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |