# How to dispose the field of date type importing data to es by logstash?

**URL:** <https://discuss.elastic.co/t/how-to-dispose-the-field-of-date-type-importing-data-to-es-by-logstash/152771>\
**Category:** Logstash\
**Created:** [October 17, 2018, 7:53am UTC](https://discuss.elastic.co/t/how-to-dispose-the-field-of-date-type-importing-data-to-es-by-logstash/152771 "2018-10-17T07:53:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shao](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@shao](https://discuss.elastic.co/u/shao)\
**Post date:** [October 17, 2018, 7:53am UTC](https://discuss.elastic.co/t/how-to-dispose-the-field-of-date-type-importing-data-to-es-by-logstash/152771/1 "2018-10-17T07:53:29Z")

</div>

I have a question look like the title, my data has a field of date type, and I need to let it be date type in es after imported it by logstash, so I use date method:

```auto
input {
  file {
    path => ["C:\Users\Desktop\test.csv"]
    start_position => "beginning"
  }
}
filter {
  csv {
    separator => ","
    columns => ["name","age","time"]
  }
  mutate {
    convert => {
      "age" => "integer"
    }      
  }
   date {
      match => ["time", "yyyy/MM/dd HH:mm:ss"]
    }
 }

output {
  elasticsearch {
        hosts => ["127.0.0.1:9200"]
        index => "test2"
		document_type => "test2"
  }
}

```

my data:

```auto
shao,1,2018/10/12 05:48:07
shao,2,2017/10/12 05:48:07
liu,3,2016/10/12 05:48:07

```

by this way, I can not solve my trouble!!!  
help me please!!!

---

<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:** [November 14, 2018, 7:53am UTC](https://discuss.elastic.co/t/how-to-dispose-the-field-of-date-type-importing-data-to-es-by-logstash/152771/2 "2018-11-14T07:53:32Z")

</div>

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