# Easier ingestion of CSV files

**URL:** <https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665>\
**Category:** Logstash\
**Created:** [December 7, 2017, 12:16pm UTC](https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665 "2017-12-07T12:16:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scch/32/25504_2.png) [@scch](https://discuss.elastic.co/u/scch)\
**Post date:** [December 7, 2017, 12:16pm UTC](https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665/1 "2017-12-07T12:16:02Z")

</div>

Is there a way to ingest csv file, where a csv field can automatically map to a specified column irrespective of its location in csv file ?

and also, how csv filter can automatically drop the header line during incremental uploads ... 🙂

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [December 7, 2017, 1:24pm UTC](https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665/2 "2017-12-07T13:24:03Z")

</div>

Neither of your questions are entirely clear to me. Perhaps you can give examples?

> Is there a way to ingest csv file, where a csv field can automatically map to a specified column irrespective of its location in csv file ?

Do you want Logstash to read the header line dynamically, or what are you asking for?

> and also, how csv filter can automatically drop the header line during incremental uploads ...

I don't see how the header line would _not_ get dropped when processing a file incrementally.

---

<div class="post-metadata">

**Author:** ![scch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/scch/32/25504_2.png) [@scch](https://discuss.elastic.co/u/scch)\
**Post date:** [December 7, 2017, 2:50pm UTC](https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665/3 "2017-12-07T14:50:28Z")

</div>

> [@magnusbaeck](#):
>
> Do you want Logstash to read the header line dynamically, or what are you asking for?

yes, and insert data accordingly.

> [@magnusbaeck](#):
>
> I don't see how the header line would not get dropped when processing a file incrementally.

i am going to try ...  
if [Type] == "Type" {  
drop { }  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 4, 2018, 2:50pm UTC](https://discuss.elastic.co/t/easier-ingestion-of-csv-files/110665/4 "2018-01-04T14:50:36Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
