lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Allow datetime values kind

Open jRimbault opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe.

I'm using lnav with structured JSON logs that include multiple UTC datetime fields besides the main timestamp. While timestamp-field works great, other datetime fields are treated as plain strings, so I can't sort or filter by them.

Describe the solution you'd like

It would be great if the format schema supported "kind": "datetime" for value fields, with an optional timestamp-format. That way, lnav could properly parse and display additional datetime fields.

Describe alternatives you've considered

Right now I just leave them as "string" and mentally parse the timestamps into my local timezone — not ideal :)

Additional context

Trying to use "kind": "datetime" results in this error:

✘ error: “datetime” is not a valid value for option “/bod_log/value/fields~1start/kind”
 --> bod.json:119
 |         "kind": "datetime"              
 = help: Property Synopsis
           /bod_log/value/fields~1start/kind <data-type>
         Description
           The type of data in the field
         Allowed Values
           string, integer, float, boolean, json, struct, quoted, xml

With lnav 0.12.3

Adding "datetime" would be more comfortable for me :)

jRimbault avatar Mar 24 '25 08:03 jRimbault

so I can't sort or filter by them.

What do you mean by sort? Is this in the context of a SQL query?

Why can't you filter on them?

That way, lnav could properly parse and display additional datetime fields.

Hmm, I'm not clear on what wouldn't work right now. I can understand that they are not adjusted based on the timezone, but is there something else?

tstack avatar Mar 24 '25 21:03 tstack

Yes in the context of an SQL query

jRimbault avatar Mar 25 '25 17:03 jRimbault

If you could give me some more details on the format of the inputs and the expected outputs, I could get something implemented. As it is, I'm not sure what I would do would actually make a difference.

tstack avatar Nov 28 '25 18:11 tstack