# Using date filter with field from autodetected column in csv plugin

**URL:** <https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965>\
**Category:** Logstash\
**Created:** [March 17, 2020, 3:43pm UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965 "2020-03-17T15:43:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafael07](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rafael07](https://discuss.elastic.co/u/rafael07)\
**Post date:** [March 17, 2020, 3:43pm UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/1 "2020-03-17T15:43:20Z")

</div>

Hello.  
I am trying to parse a date from a column, which name is autodetected using the csv plugin. The problem is that the date plugin is doing nothing with this field. If instead of using "autodetect\_column\_names" I write the name with "columns", it works. Why is this happening? How can I make this work with autodetect\_column\_names?

```
input{
    file { path => "/path/to/file.csv" }
}
filter{
    csv {
        separator => ","
        autodetect_column_names => true
    }
    date {            
        match => ["timestamp_column", "dd/MM/yy HH:mm:ss ZZZ"]
        target => "test_column"
    }  
}
output{
    stdout{ codec => "rubydebug"}
}

```

Thank you so much in advanced.

---

<div class="post-metadata">

**Author:** ![pariksh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pariksh/32/46188_2.png) [@pariksh](https://discuss.elastic.co/u/pariksh)\
**Post date:** [March 17, 2020, 4:26pm UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/2 "2020-03-17T16:26:01Z")

</div>

Did you read that

[https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html#plugins-filters-csv-autodetect\_column\_names](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html#plugins-filters-csv-autodetect_column_names)

```
Logstash pipeline workers must be set to 1 for this option to work.
```

---

<div class="post-metadata">

**Author:** ![rafael07](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rafael07](https://discuss.elastic.co/u/rafael07)\
**Post date:** [March 18, 2020, 7:28am UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/3 "2020-03-18T07:28:15Z")

</div>

Yes. It is set to 1 since the beginning.

---

<div class="post-metadata">

**Author:** ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)\
**Post date:** [March 18, 2020, 8:22am UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/4 "2020-03-18T08:22:17Z")

</div>

Hi there,

can you please post a sample of a output of that pipeline (the one with the autodetect)?

Thanks

---

<div class="post-metadata">

**Author:** ![rafael07](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rafael07](https://discuss.elastic.co/u/rafael07)\
**Post date:** [March 19, 2020, 3:24pm UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/5 "2020-03-19T15:24:39Z")

</div>

Sorry, I cannot share it because it contains sensitive information. But I have tested with a small toy example and it is working. I don't know why

---

<div class="post-metadata">

**Author:** ![Fabio-sama](https://avatars.discourse-cdn.com/v4/letter/f/b9e5f3/32.png) [@Fabio-sama](https://discuss.elastic.co/u/Fabio-sama)\
**Post date:** [March 19, 2020, 3:34pm UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/6 "2020-03-19T15:34:43Z")

</div>

That's why I asked you to post here some content. My guess is you're parsing something wrong.

If your data are sensitive, you can mask the other fields and values by putting "foo1"-"value1", "foo2"-"value2". I'm not interested in that but in what your timestamp\_column looks like.

---

<div class="post-metadata">

**Author:** ![rafael07](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@rafael07](https://discuss.elastic.co/u/rafael07)\
**Post date:** [March 26, 2020, 11:02am UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/7 "2020-03-26T11:02:56Z")

</div>

> [@Fabio-sama](#):
>
> My guess is you're parsing something wrong.

But if that where the case, it didn't make sense that it works with naming the columns instead of using the autodetect.

---

<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:** [April 23, 2020, 11:03am UTC](https://discuss.elastic.co/t/using-date-filter-with-field-from-autodetected-column-in-csv-plugin/223965/8 "2020-04-23T11:03:01Z")

</div>

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