Date format problem with Kibana ingestion

Hi,

I have a CSV file with a field date 5in french) like this : samedi 13 mai 2023 and I don't find any ISO format in Kibana to make this field recognizable as a date field during the ingestion.
If you have a solution ... Thx

You just need to set up the locale on your mapping and it should be OK to ingest.

This test worked for me, setting an index mapping that accepts both a date with your example definition and the standard YYYY-MM-dd format. Then inserted a couple docs and finally run a query to ensure that the document was correctly indexed.

DELETE discuss-333357

# Set up a date with locale in French
PUT discuss-333357
{
  "mappings": {
    "properties": {
      "my_date": {
        "type":   "date",
        "locale": "fr",
        "format": "EEEE dd MMMM yyyy||strict_date_optional_time"
      }
    }
  }
}

# Add some data
POST discuss-333357/_bulk
{ "index": {}}
{"my_date": "2023-05-29"}
{ "index": {}}
{ "my_date": "samedi 13 mai 2023"}

# Check data is processed correctly
GET discuss-333357/_search
{
  "query": {
    "range": {
      "my_date": {
        "lte": "2023-05-20"
      }
    }
  }
}

Where the last search just returns the document with the date inselted in French:

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "discuss-333357",
        "_id": "AsgoaIgB_eeZxg5A8LWK",
        "_score": 1,
        "_source": {
          "my_date": "samedi 13 mai 2023"
        }
      }
    ]
  }
}

Hope it helps!

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