mtools
mtools copied to clipboard
[mlogfilter] Add filter to output from last (n) restart(s)
If no restart (or start) message found, return a warning or error
Oops, fat-fingered. It's not closed. :)
This has now become easier, with the LogFile class offering all restarts of a log file.
Proposed syntax "restart" keyword for --from / --to
mlogfilter logfile.log --from restart
The usual modifier rules apply, so this should also be possible
mlogfilter logfile.log --from "restart -1h"
This would be pretty useful. I did a bash script for this some time ago: https://github.com/gianpaj/mongo-scripts/blob/master/rlogtail.sh
Most of the times I found that tailing from the bottom was quicker
Updated title:
Add filter to output from last (n) restart(s)