# Autogenerating field names from csv headers

**URL:** <https://discuss.elastic.co/t/autogenerating-field-names-from-csv-headers/258638>\
**Category:** Logstash\
**Created:** [December 14, 2020, 8:01pm UTC](https://discuss.elastic.co/t/autogenerating-field-names-from-csv-headers/258638 "2020-12-14T20:01:23Z")\
**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:** [December 14, 2020, 9:03pm UTC](https://discuss.elastic.co/t/autogenerating-field-names-from-csv-headers/258638/2 "2020-12-14T21:03:05Z")

</div>

If you want different columns for different events you are going to have to use a filter and conditionals. See [here](https://discuss.elastic.co/t/how-to-parse-mix-json-logs/167594/28) for an example. Possibly conditional on the filename rather than a pattern.

---

_[View the full topic](https://discuss.elastic.co/t/autogenerating-field-names-from-csv-headers/258638)._
