# Multiple CSV files and Multiple Header data \[identifiers\]

**URL:** <https://discuss.elastic.co/t/multiple-csv-files-and-multiple-header-data-identifiers/157077>\
**Category:** Logstash\
**Created:** [November 16, 2018, 2:02pm UTC](https://discuss.elastic.co/t/multiple-csv-files-and-multiple-header-data-identifiers/157077 "2018-11-16T14:02:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [November 19, 2018, 7:59pm UTC](https://discuss.elastic.co/t/multiple-csv-files-and-multiple-header-data-identifiers/157077/2 "2018-11-19T19:59:47Z")

</div>

You're referring to this post:

> [@Parse 1st Line of Multiple CSV files and set as Columns](https://discuss.elastic.co/t/parse-1st-line-of-multiple-csv-files-and-set-as-columns/2246/4):
>
> The content is always split into lines, but without a conditional, the csv filter is totally unaware of which line of a file it is receiving. This is why a conditionals are essential, and knowing what the possible column types are.
> 
> ```auto
> if [csv_type_1] {
> if [message] =~ /headerpattern/ {
> csv { ... }
> }
> }
> 
> ```
> 
> csv\_type\_1 identifies a stream (by file type, or whatever you identify it with), headerpattern will be the way you can tell the first line is a header and not data, and then you apply the _known_ csv column match to the data.
> 
> Logstash 2.x will simplify this somewhat as we are designing it to allow for multiple pipelines. A (hypothetical) CSV pipeline would allow for ingesting a single file, and using the first line to define column/field names. In the meanwhile, unfortunately there is nothing in Logstash which will do what you are asking.

Included here for quick access.

The idea behind `csv_type_1` is arbitrary. It just needs to be a way you can concretely identify the source of the data to differentiate it from other sources of data. If you only have a single source of data, this conditional is unnecessary.

---

_[View the full topic](https://discuss.elastic.co/t/multiple-csv-files-and-multiple-header-data-identifiers/157077)._
