Phani Kumar
Phani Kumar

Reputation: 178

Kibana nano seconds showing zeros

Kibana not showing nano seconds, it is showing zeros

Actually timestamp is available in nano seconds

enter image description here

How to sort the data in kibana using nano seconds precision

Upvotes: 0

Views: 582

Answers (1)

Hashirama Senju
Hashirama Senju

Reputation: 32

date data type stores dates in millisecond resolution. The date_nanos data type stores dates in nanosecond resolution, which limits its range of dates from roughly 1970 to 2262, as dates are still stored as a long representing nanoseconds since the epoch.

Queries on nanoseconds are internally converted to range queries on this long representation, and the result of aggregations and stored fields is converted back to a string depending on the date format that is associated with the field.

Date formats can be customized, but if no format is specified then it uses the default. As an example, You can customise the date field like this:

PUT my-index-000001
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date_nanos" 
      }
    }
  }
}

Upvotes: 0

Related Questions