Elasticsearch / kibana wrong epoch date indexing

the elastichsearch or kibana is goeing wrong date from epoch index.

the date value is: 1495956650 (human date: GMT: Sunday, May 28, 2017 7:30:50 AM)

but...
when indexing this record into elasticsearch with below mapping:

    PUT test
    {
        "mappings": {
        "doc": {
          "properties": {
            "date": {
                        "properties": {
                          "value": {
                            "type": "date"
                          }
                        }
                      }
              }
            }
          }
    }

when is post this data:

    POST test/doc
    {"date": {
              "value": "1495956650"
            } 
    }

i see this date in kibana after index pattern, that is wrong!

date.value:January 18th 1970, 11:02:36.650

my elasticsearch and kibana versions both are 6.2.3
and my system time is update.

the problem is because of elastic wrong guessing format of epochs.
in this situation format (epoch_second) that's working.

PUT test
{
  "mappings": {
    "doc": {
      "properties": {
        "date": {
          "properties": {
            "value": {
              "type": "date",
              "format": "epoch_second"
            }
          }
        }
      }
    }
  }
}

thanks to Olivier

Elasticsearch uses by default ms since epoch indeed.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.