# Need help Mutating a Date column from CSV

**URL:** <https://discuss.elastic.co/t/need-help-mutating-a-date-column-from-csv/113093>\
**Category:** Logstash\
**Created:** [December 24, 2017, 4:58am UTC](https://discuss.elastic.co/t/need-help-mutating-a-date-column-from-csv/113093 "2017-12-24T04:58:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Celtics2018](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@Celtics2018](https://discuss.elastic.co/u/Celtics2018)\
**Post date:** [December 24, 2017, 4:58am UTC](https://discuss.elastic.co/t/need-help-mutating-a-date-column-from-csv/113093/1 "2017-12-24T04:58:35Z")

</div>

Hi everyone,

I am quite new to using the Stack so I apologize for what may be a quite easy question, I am having trouble figuring this one out!

I am loading in a large CSV file into ES and I am mutating some of the fields to load in properly. I can get all of the data loaded in when I am only mutating for integer and float, but when I try to do DATE & GEO it throws errors. I understand that date is not a supported field type so I know something else needs to be done but I am unsure what. I am trying to mutate a DATE field where it looks like YYYY-MM-DD. Here is my config file:

```
input {
  file {
    path => "/Users/Celtics2018/documents/data/crime.csv"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}

filter {
    csv{
      separator => ","
      columns => ["ID","CaseNumber","Date","Block","IUCR",
      "PrimaryType","Description","LocationDescription",
      "Arrest","Domestic","Beat","District","Ward",
      "CommunityArea","FBI","Code","xCoordinate",
      "yCoordinate","Year","UpdatedOn","Latitude","Longitude","Location"]

    }
    mutate {convert => ["ID", "integer"]}
    **mutate {convert => ["Date", "date"]}**
    mutate {convert => ["IUCR", "integer"]}
    mutate {convert => ["beat", "integer"]}
    mutate {convert => ["District", "integer"]}
    mutate {convert => ["Ward", "integer"]}
    mutate {convert => ["CommunityArea", "integer"]}
    mutate {convert => ["xCoordinate", "integer"]}
    mutate {convert => ["yCoordinate", "integer"]}
    mutate {convert => ["Year", "integer"]}

}

output {
  elasticsearch {
    hosts => "localhost"
    index => "crime"
    document_type => "LA"
  }
  stdout{}
}

```

Please let me know if I can provide any more information or if I am unclear. Also, I am trying to mutate Lat/Long fields to GEO, so any help on that would be great too 🙂

Thank you!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 26, 2017, 7:18am UTC](https://discuss.elastic.co/t/need-help-mutating-a-date-column-from-csv/113093/2 "2017-12-26T07:18:34Z")

</div>

Parsing dates require the use of [the date filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html), and can not be done through mutate.

[This blog post](https://www.elastic.co/blog/geoip-in-the-elastic-stack) describes how geo\_point fields need to be formatted and mapped.

---

<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:** [January 23, 2018, 7:18am UTC](https://discuss.elastic.co/t/need-help-mutating-a-date-column-from-csv/113093/3 "2018-01-23T07:18:50Z")

</div>

Closed on January 23, 2018, 7:18am UTC

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