# Import CSV file

**URL:** <https://discuss.elastic.co/t/import-csv-file/15728>\
**Category:** Elasticsearch\
**Created:** [February 11, 2014, 12:33pm UTC](https://discuss.elastic.co/t/import-csv-file/15728 "2014-02-11T12:33:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bert\_Cauwelier](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@Bert\_Cauwelier](https://discuss.elastic.co/u/Bert_Cauwelier)\
**Post date:** [February 11, 2014, 12:33pm UTC](https://discuss.elastic.co/t/import-csv-file/15728/1 "2014-02-11T12:33:33Z")

</div>

Hello,

i am new to elasticsearch and i am trying to import a csv file.  
can anyoone help?

an example csv file :  
name comment  
me hello

json file  
{  
"type" : "csv",  
"csv\_file" : {  
"folder" : "~/test",  
"filename\_mask" : ".\*\.csv$",  
"poll":"5m",  
"fields" : [  
"name",  
"comment",  
],  
"field\_separator" : " ",  
"escape\_character" : ";",  
"quote\_character" : "'"  
},  
"index" : {  
"index" : "eriks import",  
"type" : "csv\_row",  
"bulk\_size" : 10000,  
"bulk\_threshold" : 50  
}  
}

but i get an error when i do :

# curl -XPOST [http://localhost:9200/\_river/my\_csv\_river/\_meta](http://localhost:9200/_river/my_csv_river/_meta) -d

insertrivercsv.json

i get :  
{"error":"MapperParsingException[failed to parse]; nested:  
ElasticSearchParseException[Failed to derive xcontent from (offset=0,  
length=19): [105, 110, 115, 101, 114, 116, 114, 105, 118, 101, 114, 99,  
115, 118, 46, 106, 115, 111, 110]]; ","status":400}[

what does this mean?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d5d95d5e-e3b3-493c-8e7b-302728bc40d3%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d5d95d5e-e3b3-493c-8e7b-302728bc40d3%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 11, 2014, 12:58pm UTC](https://discuss.elastic.co/t/import-csv-file/15728/2 "2014-02-11T12:58:32Z")

</div>

If you use curl, then check the parameters for sending valid input. You  
certainly want something like this

curl -XPOST [http://localhost:9200/\_river/my\_csv\_river/\_meta](http://localhost:9200/_river/my_csv_river/_meta) --data-binary  
@insertrivercsv.json

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH3%3DryJY%2BZbayHNCodyu0BXWkSuK8P\_nFehduC%3DgymrPg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoH3%3DryJY%2BZbayHNCodyu0BXWkSuK8P_nFehduC%3DgymrPg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Bert\_Cauwelier](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@Bert\_Cauwelier](https://discuss.elastic.co/u/Bert_Cauwelier)\
**Post date:** [February 11, 2014, 1:09pm UTC](https://discuss.elastic.co/t/import-csv-file/15728/3 "2014-02-11T13:09:29Z")

</div>

Is the @ important?

when i use the command you send i get:

# curl -XPOST [http://localhost:9200/\_river/my\_csv\_river/\_meta](http://localhost:9200/_river/my_csv_river/_meta) --data-binary

@insertrivercsv.json  
Warning: Couldn't read data from file "insertrivercsv.json", this makes an  
Warning: empty POST.  
{"error":"MapperParsingException[failed to parse, document is  
empty]","status":400}

Op dinsdag 11 februari 2014 13:58:32 UTC+1 schreef Jörg Prante:

> If you use curl, then check the parameters for sending valid input. You  
> certainly want something like this
> 
> curl -XPOST [http://localhost:9200/\_river/my\_csv\_river/\_meta](http://localhost:9200/_river/my_csv_river/_meta) --data-binary  
> @insertrivercsv.json
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9cadc170-dac1-40d2-9b15-17fecbf2168a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9cadc170-dac1-40d2-9b15-17fecbf2168a%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 11, 2014, 1:11pm UTC](https://discuss.elastic.co/t/import-csv-file/15728/4 "2014-02-11T13:11:50Z")

</div>

Read the curl man page for sending a file with @

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFQotOMXzAuCGa4Beq6gsewkGUivOJLj8vOyytNXVha7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFQotOMXzAuCGa4Beq6gsewkGUivOJLj8vOyytNXVha7Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:51am UTC](https://discuss.elastic.co/t/import-csv-file/15728/5 "2017-07-06T01:51:08Z")

</div>


