# Parse multiline CSV files of different headers using logstash http input

**URL:** <https://discuss.elastic.co/t/parse-multiline-csv-files-of-different-headers-using-logstash-http-input/127439>\
**Category:** Logstash\
**Created:** [April 10, 2018, 7:57am UTC](https://discuss.elastic.co/t/parse-multiline-csv-files-of-different-headers-using-logstash-http-input/127439 "2018-04-10T07:57:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ysree](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ysree/32/31762_2.png) [@ysree](https://discuss.elastic.co/u/ysree)\
**Post date:** [April 10, 2018, 7:57am UTC](https://discuss.elastic.co/t/parse-multiline-csv-files-of-different-headers-using-logstash-http-input/127439/1 "2018-04-10T07:57:52Z")

</div>

Hi,

Is there a way to parse multiple CSV files of different headers using logstash.

EG:

1. Post a csv file using curl command

curl -XPOST '[http://10.197.37.94:31311](http://10.197.37.94:31311)' --data-binary @mycsv.csv -H 'Content-type:text/csv; charset=utf-8'

**mycsv.csv**  
date,Hostname,procesName,processId  
1522770001,10.12.13.13,service1,1068  
1522770601,10.12.13.13,service1,1068

**Expected out put to store in Elastic search**  
{  
{  
"date": 1522770001,  
"vcName": "10.12.13.13",  
"procesName": "service1",  
"processId": 1068  
},  
{  
"date": 1522770601,  
"vcName": "10.12.13.13",  
"procesName": "service1",  
"processId": 1068  
}  
}

1. Post second csv file with different header using curl command

curl -XPOST '[http://10.197.37.94:31311](http://10.197.37.94:31311)' --data-binary @mycsv1.csv -H 'Content-type:text/csv; charset=utf-8'

**mycsv1.csv**  
date,Hostname,service,cpu,memory,disk  
1522770001,10.12.13.13,service1,1068,1,30  
1522770601,10.12.13.13,service2,1068,2,50

**Expected out put to store in Elastic search**  
{  
"date": 1522770001,  
"Hostname": "10.12.13.13",  
"service": "service1",  
"cpu": 1068,  
"memory": 1,  
"disk": 30  
},  
{  
"date": 1522770601,  
"Hostname": "10.12.13.13",  
"service": "service2",  
"cpu": 1068,  
"memory": 2,  
"disk": 50  
}

Thanks in advance

---

<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:** [May 8, 2018, 7:58am UTC](https://discuss.elastic.co/t/parse-multiline-csv-files-of-different-headers-using-logstash-http-input/127439/2 "2018-05-08T07:58:18Z")

</div>

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