# Accepted Date datatype for a field

**URL:** https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889
**Category:** Elasticsearch
**Created:** [July 4, 2019, 10:25am UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889 "2019-07-04T10:25:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![GitsBdr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gitsbdr/32/58828_2.png) [@GitsBdr](https://discuss.elastic.co/u/GitsBdr)
#### Post date: [July 4, 2019, 10:25am UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/1 "2019-07-04T10:25:50Z")

</div>

Hi guys,

I'm trying to automatically import files into Kibana using logstash and its schedule parameter  
Nothing so tricky so far but I'm getting errors about the date format  
I'm talking here about files containing billion lines (so very complicated to amend them before the logstash process)  
I was wondering if Elastic can handle the format "2017-06-01 23:38:14.904 UTC" or if there is a way to modify this date during the logstash process to the "2017-06-01T23:38:14Z" format

Thanks for your help

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 4, 2019, 1:03pm UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/2 "2019-07-04T13:03:22Z")

</div>

Here is an example:

```auto
DELETE test 
PUT test 
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "y-M-d H:m:s.SSS z"
      }
    }
  }
}
PUT test/_doc/1
{
  "date": "2017-06-01 23:38: 14.904 UTC"
}

```

---

<div class="post-metadata">

### Author: ![GitsBdr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gitsbdr/32/58828_2.png) [@GitsBdr](https://discuss.elastic.co/u/GitsBdr)
#### Post date: [July 4, 2019, 2:07pm UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/3 "2019-07-04T14:07:06Z")

</div>

Hi there !  
Lovely idea,  
So I should pre create my index first with the mapping I want and then start inserting data with logstash ? Is that correct ?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 4, 2019, 2:19pm UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/4 "2019-07-04T14:19:03Z")

</div>

Correct.

---

<div class="post-metadata">

### Author: ![GitsBdr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gitsbdr/32/58828_2.png) [@GitsBdr](https://discuss.elastic.co/u/GitsBdr)
#### Post date: [July 4, 2019, 2:21pm UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/5 "2019-07-04T14:21:01Z")

</div>

Thanks. Let me try it out and I'll get back to you or close it if solved

---

<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: [August 1, 2019, 2:21pm UTC](https://discuss.elastic.co/t/accepted-date-datatype-for-a-field/188889/6 "2019-08-01T14:21:12Z")

</div>

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