Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamp-format day of year "%j" pattern #1321

Open
mvaladas opened this issue Oct 24, 2024 · 1 comment
Open

Add timestamp-format day of year "%j" pattern #1321

mvaladas opened this issue Oct 24, 2024 · 1 comment
Labels
enhancement Feature Request

Comments

@mvaladas
Copy link

My logs are timestamped with a format YYYY-DDDTHH:MM:SS. Using the day of year for the date.

The timestamp-format does not currently support the strftime %j pattern.

Would it be possible to add this pattern? If I am pointed in the right direction I wouldn't mind implementing myself as submit a pull request

@mvaladas mvaladas added the enhancement Feature Request label Oct 24, 2024
@tstack
Copy link
Owner

tstack commented Oct 25, 2024

Would it be possible to add this pattern? If I am pointed in the right direction I wouldn't mind implementing myself as submit a pull request

lnav has a custom timestamp parser/formatter in here:

https://github.com/tstack/lnav/blob/master/src/ptimec.hh
https://github.com/tstack/lnav/blob/master/src/ptimec_rt.cc

So, you would have to add the new directive in there.

The tm2sec() function converts the tm struct to epoch time, so that will need to be modified to pay attention to tm_yday (if it is set).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants