# Import CSV - Column names are also present in the values

**URL:** <https://discuss.elastic.co/t/import-csv-column-names-are-also-present-in-the-values/47383>\
**Category:** Logstash\
**Created:** [April 14, 2016, 12:30pm UTC](https://discuss.elastic.co/t/import-csv-column-names-are-also-present-in-the-values/47383 "2016-04-14T12:30:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/denny/32/9157_2.png) [@Denny](https://discuss.elastic.co/u/Denny)\
**Post date:** [April 14, 2016, 12:30pm UTC](https://discuss.elastic.co/t/import-csv-column-names-are-also-present-in-the-values/47383/1 "2016-04-14T12:30:13Z")

</div>

Hi,

I've used Logstash to import a csv-file which works great and all was looking good but then I tried another csv-file and then I saw something strange. In Kibana I saw that the headers of the file are also in the values and I have no idea why this has happened.

My dataset looks more or less like this (in bold the column names):

**`C1 C2 C3`**  
`10 AB 15`  
`20 CD 12`  
`30 EF 16 `

This is the .conf I use to index a csv-file:

> input  
> {  
> file  
> {  
> path =\> "/home/denny/test.csv"  
> start\_position =\> "beginning"  
> ignore\_older =\> 0  
> sincedb\_path =\> "/dev/null"  
> }  
> }

> filter  
> {  
> csv {  
> columns =\> ["C1", "C2", "C3]  
> separator =\> ","  
> }  
> }

> output  
> {  
> elasticsearch {  
> action =\> "index"  
> hosts =\> "localhost"  
> index =\> "test"  
> workers =\> 1  
> }  
> stdout {}  
> }

And once it has been indexed and I go to Kibana. I grab the new index and then I go to Discover. Then I click on a column and I see that the name of the column is also present in the values. So when I visualize a bar chart then the column names will also have a bar of its own .

I did not encounter this with the first csv I have indexed with Logstash so I find it strange why this would happen and I hope someone can enlighten me 🙂

EDIT: The first csv-file was one I downloaded from the internet to try it out (the titanic dataset from Kaggle), this dataset has been made by me with Excel.

---

<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:** [April 15, 2016, 6:05am UTC](https://discuss.elastic.co/t/import-csv-column-names-are-also-present-in-the-values/47383/2 "2016-04-15T06:05:38Z")

</div>

Logstash's file input knows nothing about CSV files and the csv filter doesn't know about skipping the first line. See [https://github.com/logstash-plugins/logstash-filter-csv/issues/13](https://github.com/logstash-plugins/logstash-filter-csv/issues/13).

---

<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:** [July 6, 2017, 5:02am UTC](https://discuss.elastic.co/t/import-csv-column-names-are-also-present-in-the-values/47383/3 "2017-07-06T05:02:09Z")

</div>


