Open ghost opened 12 years ago
Thanks for the suggestion, Robert. If you're comfortable sharing what led you to want the last message, that would be really helpful.
Also, would you use that instead of piping it through head -1
(if you've tried it)?
Yeah, piping it into tail is what i'm doing now.
What i'm using it for specifically is finding the most recent (i.e: last) message in papertrail for a host, to check that centralised messages are still being received for each host. It'd be even better if you could give -s systemname -l and get back the epoch time of the last message, or something, but limiting the rows returned and having to process the timestamp is also ok.
It would be very handy if you could limit the number of rows returned.
e.g: papertrail -n 1 -s systemname
To return just the latest log line for a system.