Date mapping issue

HI all, can't fight with it anymore, need help.
I have an input 'localtime' field with text formatted as '2024-12-06 08:40:36.000404894'.
Index mapping for this:

      "localtime": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss.nnnnnnnnn"

I have two troubles:
In kibana view I see no precise values:

event.original
2024-12-06 08:40:53.000086923
localtime
2024-12-06 08:40:53.000000000

and second one - localtime stored as Keyword, so I can't use this field as default timestamp in Kibana (it's a point).

Stack version: 8.2.12

If you look at the documentation the date field type only supports millisecond accuracy. To get full accuracy for your field you would need to use the date_nanos field type.

This is getting quite old, so I would recommend you upgrade to the latest version.

Oh, my bad. Correct version is 8.12.2.
Also, changing to date_nanos helps me to avoid inaccurate values, now its good with nanoseconds, thanks!
But field is still stored as 'Keyword' with no possibility to use it as correct timestamp.

Upd: changing existing kibana view don't allow to use 'localtime' as timestamp, but when I try to create new one with same index-pattern - I can choose 'localtime' as timestamp. Victory!

1 Like