Using a custom time format doesn't work

I'm really stuggling. My elasticsearch data and mapping is in this format:

Data

{
  "test" : [ {
    "data" : "119050300",
    "date" : "10:00 2019-06-03"
  } ]
}

Mapping

{
  "mappings": {
    "properties": {
      "date": {
        "type":   "date",
        "format": "HH:mm yyyy-MM-dd"
      },
        "data": {
        "type":   "integer"
      }
    }
  }
}

However it fails to actually identify it as a date, and convert it to a timestamp internally. Nor is it possible to use in Kibana. However, if I remove the time aspect and do this instead, it works fine:

Data

{
  "test" : [ {
    "data" : "119050300",
    "date" : "2019-06-03"
  } ]
}

Map

{
  "mappings": {
    "properties": {
      "date": {
        "type":   "date",
        "format": "yyyy-MM-dd"
      },
        "data": {
        "type":   "integer"
      }
    }
  }
}

Can someone please tell me how to include the time and not have it break.

your mapping does match your document. The document has a test.date field, but your mapping is mapped to a date field

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