# Autodetect\_column\_name with 2 different CSV

**URL:** <https://discuss.elastic.co/t/autodetect-column-name-with-2-different-csv/313310>\
**Category:** Logstash\
**Created:** [August 31, 2022, 5:09am UTC](https://discuss.elastic.co/t/autodetect-column-name-with-2-different-csv/313310 "2022-08-31T05:09:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 31, 2022, 4:41pm UTC](https://discuss.elastic.co/t/autodetect-column-name-with-2-different-csv/313310/4 "2022-08-31T16:41:47Z")

</div>

With autodetect\_column\_names the [code](https://github.com/logstash-plugins/logstash-filter-csv/blob/30b2c232293f9b0e11bdc36938c32b15731de3e8/lib/logstash/filters/csv.rb#L143) eats the first line to use as column names and never changes them. See [this](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) thread for a way to support multiple CSV formats.

---

_[View the full topic](https://discuss.elastic.co/t/autodetect-column-name-with-2-different-csv/313310)._
