Date incorrectly parsed

Hello,

i can't get this date parsed correctly

20220113T21:00:18.965901

date {
     match => ["fill_date", "yyyMMdd'T'HH:mm:ss.SSSSSS"]
     target => "@timestamp"
}

Best

Hi,

you should try without single quotting.

something like "yyyyMMddTHH:mm:ss"

Thanks grumo35 but it doesn't work

date {
  match => ["fill_date", "yyyMMddTHH:mm:ss.SSSSSS"]     
  target => "@timestamp"
}

It throws an error


This format starts with 3 ys but 4 ys is correct.

It worked fine for me.

PUT /test_datetime/
{
  "mappings": {
    "properties": {
      "date": {
        "type":   "date",
        "format": ["yyyyMMdd'T'HH:mm:ss.SSSSSS"]
      }
    }
  }
}

POST /test_datetime/_doc
{
  "date": "20220113T21:00:18.965901"
}
-> ok

POST /test_datetime/_doc
{
  "date": "20220113T21:00:18"
}
-> error

GET /test_datetime/_search
1 Like

Many thanks Tomo_M & Grumo35 it was my fault, yyyy instead of yyy

Best

1 Like

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