# Csv-river

**URL:** <https://discuss.elastic.co/t/csv-river/13419>\
**Category:** Elasticsearch\
**Created:** [August 31, 2013, 6:05am UTC](https://discuss.elastic.co/t/csv-river/13419 "2013-08-31T06:05:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![signin\_vasanth](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@signin\_vasanth](https://discuss.elastic.co/u/signin_vasanth)\
**Post date:** [August 31, 2013, 6:05am UTC](https://discuss.elastic.co/t/csv-river/13419/1 "2013-08-31T06:05:32Z")

</div>

Hi

I installed csv-river in elastic search plugins folder and try to execute  
the following command via curl,

curl -XPUT "localhost:9200/\_river/my\_csv\_river/\_meta" -d { "type" :  
"csv", "csv\_file" : {"folder" : "c:\test.csv","filename\_mask" :  
".\*\.csv$","poll":"5m","fields" :  
["EmpId","EmpName"],"field\_separator" : ",","escape\_character"  
: ";","quote\_character" : "'"},"index" : {"index" :  
"my\_csv\_data","type" : "csv\_row","bulk\_size" :  
10000,"bulk\_threshold" : 50}}"

I am getting this error _org.elasticsearch.index.mapper.MapperParsingException:  
failed to parse_

What are the steps needed to correct it or what's wrong in my curl cmd.

Note \*:  
I m using _windows os_ so that i used slash in curl cmd

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![btiernay](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@btiernay](https://discuss.elastic.co/u/btiernay)\
**Post date:** [August 31, 2013, 1:44pm UTC](https://discuss.elastic.co/t/csv-river/13419/2 "2013-08-31T13:44:03Z")

</div>

Have you looked at the elasticsearch log? Could you post the response of  
the request that indicates the error?

Thanks,

Bob

On Saturday, 31 August 2013 02:05:32 UTC-4, Vasanthakumar Rajendran wrote:

> Hi
> 
> I installed csv-river in Elasticsearch plugins folder and try to execute  
> the following command via curl,
> 
> curl -XPUT "localhost:9200/\_river/my\_csv\_river/\_meta" -d { "type" :  
> "csv", "csv\_file" : {"folder" : "c:\test.csv","filename\_mask" :  
> ".\*\.csv$","poll":"5m","fields" :  
> ["EmpId","EmpName"],"field\_separator" : ",","escape\_character"  
> : ";","quote\_character" : "'"},"index" : {"index" :  
> "my\_csv\_data","type" : "csv\_row","bulk\_size" :  
> 10000,"bulk\_threshold" : 50}}"
> 
> I am getting this error _org.elasticsearch.index.mapper.MapperParsingException:  
> failed to parse_
> 
> What are the steps needed to correct it or what's wrong in my curl cmd.
> 
> Note \*:  
> I m using _windows os_ so that i used slash in curl cmd

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Israel\_Ekpo](https://avatars.discourse-cdn.com/v4/letter/i/49beb7/32.png) [@Israel\_Ekpo](https://discuss.elastic.co/u/Israel_Ekpo)\
**Post date:** [September 1, 2013, 1:37am UTC](https://discuss.elastic.co/t/csv-river/13419/3 "2013-09-01T01:37:13Z")

</div>

I am not sure which programming language you are comfortable with.

I use PHP for simple scripts like this.

If that is not working out you could use PHP to read the CSV file and then  
use CURL to send the requests to ES to index it.

So first, I will create and index and a mapping for the type that I want to  
import.

Then read the CSV file to extract the rows.

Then index each row in ES

Here are some links that could help with this:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

[http://php.net/manual/en/function.fgetcsv.php](http://php.net/manual/en/function.fgetcsv.php)

[http://www.php.net/manual/en/function.curl-setopt.php](http://www.php.net/manual/en/function.curl-setopt.php)  
[http://www.php.net/manual/en/function.curl-exec.php](http://www.php.net/manual/en/function.curl-exec.php)

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

_Author and Instructor for the Upcoming Book and Lecture Series_  
_Massive Log Data Aggregation, Processing, Searching and Visualization with  
Open Source Software_  
_[http://massivelogdata.com](http://massivelogdata.com)_

On Sat, Aug 31, 2013 at 9:44 AM, btiernay [rtiernay@gmail.com](mailto:rtiernay@gmail.com) wrote:

> Have you looked at the elasticsearch log? Could you post the response of  
> the request that indicates the error?
> 
> Thanks,
> 
> Bob
> 
> On Saturday, 31 August 2013 02:05:32 UTC-4, Vasanthakumar Rajendran wrote:
> 
> > Hi
> > 
> > I installed csv-river in Elasticsearch plugins folder and try to execute  
> > the following command via curl,
> > 
> > curl -XPUT "localhost:9200/_river/my\_csv_\*\*river/_meta" -d { "type" :  
> > "csv", "csv\_file" : {"folder" : "c:\test.csv","filename_**mask"  
> > : ".\*\.csv$","poll":"5m",**"fields" : ["EmpId","EmpName"],"  
> > \*\*field\_separator" : ",","escape\_character" :  
> > ";","quote\_character" : "'"},"index" : {"index" :  
> > "my\_csv\_data","type" : "csv\_row","bulk\_size" :  
> > 10000,"bulk\_threshold" : 50}}"
> > 
> > I am getting this error _org.elasticsearch.index.mapper.MapperParsingException:  
> > failed to parse_
> > 
> > What are the steps needed to correct it or what's wrong in my curl cmd.
> > 
> > Note \*:  
> > I m using _windows os_ so that i used slash in curl cmd
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Justin\_MacCarthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/justin_maccarthy/32/2020_2.png) [@Justin\_MacCarthy](https://discuss.elastic.co/u/Justin_MacCarthy)\
**Post date:** [September 1, 2013, 6:41am UTC](https://discuss.elastic.co/t/csv-river/13419/4 "2013-09-01T06:41:29Z")

</div>

You seem to be missing a quote after -d

On Saturday, August 31, 2013 1:05:32 PM UTC+7, Vasanthakumar Rajendran  
wrote:

> Hi
> 
> I installed csv-river in Elasticsearch plugins folder and try to execute  
> the following command via curl,
> 
> curl -XPUT "localhost:9200/\_river/my\_csv\_river/\_meta" -d { "type" :  
> "csv", "csv\_file" : {"folder" : "c:\test.csv","filename\_mask" :  
> ".\*\.csv$","poll":"5m","fields" :  
> ["EmpId","EmpName"],"field\_separator" : ",","escape\_character"  
> : ";","quote\_character" : "'"},"index" : {"index" :  
> "my\_csv\_data","type" : "csv\_row","bulk\_size" :  
> 10000,"bulk\_threshold" : 50}}"
> 
> I am getting this error _org.elasticsearch.index.mapper.MapperParsingException:  
> failed to parse_
> 
> What are the steps needed to correct it or what's wrong in my curl cmd.
> 
> Note \*:  
> I m using _windows os_ so that i used slash in curl cmd

--  
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).  
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, 2:18am UTC](https://discuss.elastic.co/t/csv-river/13419/5 "2017-07-06T02:18:37Z")

</div>


