# Autodetect\_column\_names is not working as expected in csv filter plugin

**URL:** <https://discuss.elastic.co/t/autodetect-column-names-is-not-working-as-expected-in-csv-filter-plugin/333269>\
**Category:** Logstash\
**Created:** [May 12, 2023, 8:43am UTC](https://discuss.elastic.co/t/autodetect-column-names-is-not-working-as-expected-in-csv-filter-plugin/333269 "2023-05-12T08:43:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 12, 2023, 3:53pm UTC](https://discuss.elastic.co/t/autodetect-column-names-is-not-working-as-expected-in-csv-filter-plugin/333269/2 "2023-05-12T15:53:35Z")

</div>

autodetect\_column\_names sets the names once and never changes them. If you want multiple sets of column names then you need multiple csv filters.

You may be able to use a conditional based on the [number of fields](https://discuss.elastic.co/t/using-ruby-to-count-the-number-of-fields-in-a-message-then-apply-csv-depending-on-the-count/177880/2), or else based on the [log][file][path].

---

_[View the full topic](https://discuss.elastic.co/t/autodetect-column-names-is-not-working-as-expected-in-csv-filter-plugin/333269)._
