# Dynamic Mapping CSV file

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-csv-file/97709>\
**Category:** Logstash\
**Created:** [August 21, 2017, 6:03am UTC](https://discuss.elastic.co/t/dynamic-mapping-csv-file/97709 "2017-08-21T06:03:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chriss](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@Chriss](https://discuss.elastic.co/u/Chriss)\
**Post date:** [August 21, 2017, 6:03am UTC](https://discuss.elastic.co/t/dynamic-mapping-csv-file/97709/1 "2017-08-21T06:03:08Z")

</div>

Hello,

i have an CSV file which i need to import into Elasticsearch.

For now it is released with grok:

grok  
{  
match =\> { "message" =\> "%{NUMBER:count}?;(?[^\d]\*(\d+))(?[a-zA-Z]+)(?[0-9]{4});%{TIME:time}?;[...]  
}

Unfortunately the CSV files header is changing everyday. So the static way with grok will not work.

Is there an easy way to use the header of the CSV for the mapping? Could you please give me a example?

Best Regards,  
Christian

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 21, 2017, 7:06am UTC](https://discuss.elastic.co/t/dynamic-mapping-csv-file/97709/2 "2017-08-21T07:06:17Z")

</div>

There's no easy way to do this unfortunately. You may want to follow [https://github.com/elastic/logstash/issues/2088](https://github.com/elastic/logstash/issues/2088)

---

<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:** [September 18, 2017, 7:19am UTC](https://discuss.elastic.co/t/dynamic-mapping-csv-file/97709/3 "2017-09-18T07:19:41Z")

</div>

Closed on September 18, 2017, 7:19am UTC

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