lnav icon indicating copy to clipboard operation
lnav copied to clipboard

User defined timestamp format

Open geekscrapy opened this issue 4 years ago • 2 comments

Is there currently a way to reformat the time shown in the text view? Or create a virtual column with a user formatted timestamp?

Potentially to create an extra column with a user defined time format for that log line? Like when you show the time delta between log lines in the left?

It would be great if this could also be used on writing the output to files etc.

geekscrapy avatar Nov 06 '19 07:11 geekscrapy

I think specifying the timestamp format is only available for JSON logs at the moment. Plain-text logs just show things as-is.

tstack avatar Nov 08 '19 16:11 tstack

Ok, understandable. My use case is that I have to report and do analysis with a set format YYYY-MM-DD hh:mm:ss . So it'd be great able to view the logs in this format and have the option to output them with this timestamp as an extra (and probably the 1st) column. This would help so much when viewing logs where the timestamp is in a fairly irregular offset (in the log line) or an unusual format thats unfamiliar to the user (i.e. US formatted times being analysed by a UK analyst).

geekscrapy avatar Nov 08 '19 20:11 geekscrapy