# How to load csv file into elasticsearch for visualizaion in kibana

**URL:** <https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501>\
**Category:** Logstash\
**Created:** [September 26, 2016, 10:54am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501 "2016-09-26T10:54:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaishil\_Dhal](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jaishil\_Dhal](https://discuss.elastic.co/u/Jaishil_Dhal)\
**Post date:** [September 26, 2016, 10:54am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/1 "2016-09-26T10:54:20Z")

</div>

I have csv file that i attached with this. ![](https://us1.discourse-cdn.com/elastic/original/2X/a/adac6a16b7299c2eb8ab887ef85cb15aceb259bb.png)

I have already try with logstash, with this i can able to open that file but can not do the visualization in kibana. its shows some error. I m using the following code for logstash::  
input {  
file {  
path =\> "/home/hdcluster/data.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter {  
csv {  
separator =\> ","

```
 columns => ["DATE","TIME","LATITUDE","LONGITUDE","TEMP","VIBRATION"]

```

}  
}  
output {  
elasticsearch {  
action =\> "index"  
hosts =\> "[http://localhost:9200](http://localhost:9200)"  
index =\> "data"  
workers =\> 1  
}  
stdout {}  
}

that tutorial provided by "elastic- team" that i have already done, its working perfectly.(that shakesper, amount and bank problem). But for my data set it will not work so please help me to load this data.  
Thank you

---

<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:** [September 26, 2016, 7:44pm UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/2 "2016-09-26T19:44:04Z")

</div>

> its shows some error

What error?

---

<div class="post-metadata">

**Author:** ![Jaishil\_Dhal](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jaishil\_Dhal](https://discuss.elastic.co/u/Jaishil_Dhal)\
**Post date:** [September 27, 2016, 5:05am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/3 "2016-09-27T05:05:29Z")

</div>

At time of configuration as an index what should I take? Date or @timestamp

If i take timestamp this is what i got..

 ![](https://us1.discourse-cdn.com/elastic/original/2X/a/aef5d5652c420e4f025f152a9d078108a2ae9e0c.png)

why is this showing like this  
message:2016-09-12,11:06:42,13.059061,80.256934,30,202@version:1@timestamp:September 27th 2016, 10:23:40.559path:/home/hdcluster/data.csvhost:namenodeDATE:September 12th 2016, 05:30:00.000TIME:11:06:42LATITUDE:13.059061LONGITUDE:80.256934TEMP:30VIBRATION:202\_id:AVdp\_cexVEIAnSsq2H5A\_type:logs\_index:sample\_score:1

my dataset only have date,time,latitude,longitude,temp and vibration  
but it was showing message, version, path

and if I take Date than this thing i got.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/d/dee31c503a091be225759287f2402572fdf2b2c0.png)

---

<div class="post-metadata">

**Author:** ![Jaishil\_Dhal](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jaishil\_Dhal](https://discuss.elastic.co/u/Jaishil_Dhal)\
**Post date:** [September 27, 2016, 5:11am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/4 "2016-09-27T05:11:46Z")

</div>

I want to show line chart or area chart with using time and vibration column.

---

<div class="post-metadata">

**Author:** ![Meenal.Luktuke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/meenal.luktuke/32/7795_2.png) [@Meenal.Luktuke](https://discuss.elastic.co/u/Meenal.Luktuke)\
**Post date:** [September 27, 2016, 5:30am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/5 "2016-09-27T05:30:46Z")

</div>

You will have to use date plugin in Logstash to parse the time. In your case, below should be the conf:  
filter  
{  
csv {  
columns =\> ["DATE","TIME","LATITUDE","LONGITUDE","TEMP","VIBRATION"]  
}  
mutate {  
add\_field =\> {  
"Incident Date" =\> "%{DATE}%{TIME}"  
}  
}  
date  
{  
match =\> ["insert\_date", "YYYY-MM-ddHH:mm:ss"]  
}  
}

---

<div class="post-metadata">

**Author:** ![Jaishil\_Dhal](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jaishil\_Dhal](https://discuss.elastic.co/u/Jaishil_Dhal)\
**Post date:** [September 27, 2016, 5:48am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/6 "2016-09-27T05:48:47Z")

</div>

Thank u for ur replay @Meenal.Luktuke

but i have a confusion that i have to match date with my all data set?  
means i have to manually enter all the date??

---

<div class="post-metadata">

**Author:** ![Meenal.Luktuke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/meenal.luktuke/32/7795_2.png) [@Meenal.Luktuke](https://discuss.elastic.co/u/Meenal.Luktuke)\
**Post date:** [September 27, 2016, 5:56am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/7 "2016-09-27T05:56:05Z")

</div>

Matching using date filter is only for format. Elasticsearch, by default, will expect the value of @timestamp in format: YYYY-MM-ddTHH:mm:ss  
Since you don't have that,

1. concat DATE and TIME to create a new field
2. Using date filter, make this new field as @timestamp

---

<div class="post-metadata">

**Author:** ![Jaishil\_Dhal](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@Jaishil\_Dhal](https://discuss.elastic.co/u/Jaishil_Dhal)\
**Post date:** [September 27, 2016, 6:01am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/8 "2016-09-27T06:01:04Z")

</div>

Okiez I ll try. Thank u ones again 🙂

---

<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, 4:36am UTC](https://discuss.elastic.co/t/how-to-load-csv-file-into-elasticsearch-for-visualizaion-in-kibana/61501/9 "2017-07-06T04:36:44Z")

</div>


