pino-pretty
pino-pretty copied to clipboard
How to filter the log time?
The --search
parameter is great for searching within the JSON content but how would I filter the logs for the timestamp? Let's say I wanted all log entries from 17:10 to 17:19, how would I do that?
I don't know. We support http://jmespath.org/examples.html as the syntax. Would you like to send a PR with an example?
I just realized that my question was a bit unclear, sorry about that. What I wanted to ask is: In the logfile I have the time logged as 1541774026820
for example. How could I formulate a search query along the lines of time >= 2018-11-09 17:10:00
?
http://getpino.io/#/docs/help?id=filter-logs
Convert your starting time to milliseconds and proceed with filtering.
Thanks, that's how I'm currently doing it. I was actually hoping for some date/time arithmetic logic in the search query.