# Logstash can't recognize csv columns

**URL:** <https://discuss.elastic.co/t/logstash-cant-recognize-csv-columns/196396>\
**Category:** Logstash\
**Created:** [August 22, 2019, 7:17pm UTC](https://discuss.elastic.co/t/logstash-cant-recognize-csv-columns/196396 "2019-08-22T19:17:42Z")\
**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:** [August 22, 2019, 8:12pm UTC](https://discuss.elastic.co/t/logstash-cant-recognize-csv-columns/196396/2 "2019-08-22T20:12:35Z")

</div>

autodetect\_column\_names uses the very first event that logstash sees to determine the column names and never changes them. You could [count columns](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 do a conditional based on the filename.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-cant-recognize-csv-columns/196396)._
