# Importing csv met date format error

**URL:** https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457
**Category:** Kibana
**Created:** [May 8, 2021, 3:55am UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457 "2021-05-08T03:55:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Jeff-Tian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeff-tian/32/88425_2.png) [@Jeff-Tian](https://discuss.elastic.co/u/Jeff-Tian)
#### Post date: [May 8, 2021, 3:55am UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457/1 "2021-05-08T03:55:46Z")

</div>

I'm quite new on kibana and I met the following error when importing csv file:

```auto
    File could not be read
        [illegal_argument_exception] failed to parse date field [3/3/2021 21:40:25.76] with 
        format [d/M/yyyy HH:mm:ss||dd/M/yyyy HH:mm:ss.SSS||dd/M/yyyy 
        HH:mm:ss||d/M/yyyy HH:mm:ss.SSS||dd/MM/yyyy HH:mm:ss.SSS||dd/MM/yyyy 
        HH:mm:ss]

```

I did some search but did not find solution. Seems I can change the date format settings, but I don't know how.

Could anyone shed some lights here?

* * *

I started the kibana and elasticsearch locally by `docker-compose up -d` where the `docker-compose.yaml` file is as follow:

```auto
version: "3"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.2-amd64
    env_file:
      - elasticsearch.env
    volumes:
      - ./data/elasticsearch:/usr/share/elasticsearch/data
    ports:
    - 9200:9200
    - 9300:9300

  kibana:
    image: docker.elastic.co/kibana/kibana:7.9.2
    env_file:
      - kibana.env
    ports:
      - 5601:5601

```

---

<div class="post-metadata">

### Author: ![Sandeep\_Raju](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Sandeep\_Raju](https://discuss.elastic.co/u/Sandeep_Raju)
#### Post date: [May 8, 2021, 7:49am UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457/2 "2021-05-08T07:49:38Z")

</div>

There is a special character in date format: dd/MM/y`yyy HH:mm:ss.SSS  
Can u correct and check if the error is from the above?

---

<div class="post-metadata">

### Author: ![Jeff-Tian](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeff-tian/32/88425_2.png) [@Jeff-Tian](https://discuss.elastic.co/u/Jeff-Tian)
#### Post date: [May 8, 2021, 7:53am UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457/3 "2021-05-08T07:53:55Z")

</div>

Sorry it's typo. Now I've updated the question body.

---

<div class="post-metadata">

### Author: ![Sandeep\_Raju](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@Sandeep\_Raju](https://discuss.elastic.co/u/Sandeep_Raju)
#### Post date: [May 8, 2021, 2:38pm UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457/4 "2021-05-08T14:38:26Z")

</div>

If you are using 1 date format you have follow that for all data records.  
Incase you are using more than 1 date format, You have to define it in mapping:

```auto
PUT my-index-000001
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
      }
    }
  }
}

```

You can check out more details at:

> **[Date field type | Elasticsearch Guide \[7.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html)**

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 5, 2021, 2:39pm UTC](https://discuss.elastic.co/t/importing-csv-met-date-format-error/272457/5 "2021-06-05T14:39:20Z")

</div>

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