# Help with ElasticSearch Bulk index api

**URL:** <https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022>\
**Category:** Elasticsearch\
**Created:** [May 23, 2018, 3:52pm UTC](https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022 "2018-05-23T15:52:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lo\_ronk](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@lo\_ronk](https://discuss.elastic.co/u/lo_ronk)\
**Post date:** [May 23, 2018, 3:52pm UTC](https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022/1 "2018-05-23T15:52:32Z")

</div>

Hello --

This may be an obvious fix so I apologize as I am very new to the Elastic Search platform but I am attempting to use the Elastic Search Bulk API to index some data but am running into issues. Please find what I am attempting below:

curl -H 'Content-Type: application/json' -XPOST [http://localhost:9200/products/demo/\_bulk](http://localhost:9200/products/demo/_bulk) --data-binary @/usr/share/elasticsearch/bulk-test2.json

Error Message:

```auto
{"error":{"root_cause":[{"type":"json_parse_exception","reason":"Unrecognized token 'me': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@16ce447b; line: 1, column: 4]"}],"type":"json_parse_exception","reason":"Unrecognized token 'me': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@16ce447b; line: 1, column: 4]"},"status":500}[root@es-demo-6d544bc556-k5fjt elasticsearch]#

```

The bulk-test2.json data looks like this -- it is sample data from Best Buy that I am using as a test index for Elastic Search:

```auto
{"index":{}}
{"sku":43900,"name":"Duracell - AAA Batteries (4-Pack)","type":"HardGood","price":5.49,"upc":"041333424019","category":[{"id":"pcmcat312300050015","name":"Connected Home & Housewares"},{"id":"pcmcat248700050021","name":"Housewares"},{"id":"pcmcat303600050001","name":"Household Batteries"},{"id":"abcat0208002","name":"Alkaline Batteries"}],"shipping":5.49,"description":"Compatible with select electronic devices; AAA size; DURALOCK Power Preserve technology; 4-pack","manufacturer":"Duracell","model":"MN2400B4Z","url":"http://www.bestbuy.com/site/duracell-aaa-batteries-4-pack/43900.p?id=1051384074145&skuId=43900&cmp=RMXCC","image":"http://img.bbystatic.com/BestBuy_US/images/products/4390/43900_sa.jpg"}
{"index":{}}
{"sku":48530,"name":"Duracell - AA 1.5V CopperTop Batteries (4-Pack)","type":"HardGood","price":5.49,"upc":"041333415017","category":[{"id":"pcmcat312300050015","name":"Connected Home & Housewares"},{"id":"pcmcat248700050021","name":"Housewares"},{"id":"pcmcat303600050001","name":"Household Batteries"},{"id":"abcat0208002","name":"Alkaline Batteries"}],"shipping":5.49,"description":"Long-lasting energy; DURALOCK Power Preserve technology; for toys, clocks, radios, games, remotes, PDAs and more","manufacturer":"Duracell","model":"MN1500B4Z","url":"http://www.bestbuy.com/site/duracell-aa-1-5v-coppertop-batteries-4-pack/48530.p?id=1099385268988&skuId=48530&cmp=RMXCC","image":"http://img.bbystatic.com/BestBuy_US/images/products/4853/48530_sa.jpg"}

```

Any help would be greatly appreciated and thank you!!

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [May 25, 2018, 2:38pm UTC](https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022/2 "2018-05-25T14:38:04Z")

</div>

I was trying to reproduce the issue with the date that you have provided, but everything works fine here. Is it possible that you bulk-test2.json file contains some symbols that were not posted in the forum correctly?

---

<div class="post-metadata">

**Author:** ![lo\_ronk](https://avatars.discourse-cdn.com/v4/letter/l/a6a055/32.png) [@lo\_ronk](https://discuss.elastic.co/u/lo_ronk)\
**Post date:** [May 29, 2018, 4:14pm UTC](https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022/3 "2018-05-29T16:14:35Z")

</div>

Igor --

Thank you for the response. You were absolutely right -- I was missing a single { from my original file. This is why a second set of eyes is always a good idea.

Thank you so much for taking the time to test this and confirming -- I was starting to go a little crazy.

---

<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:** [June 26, 2018, 4:27pm UTC](https://discuss.elastic.co/t/help-with-elasticsearch-bulk-index-api/133022/4 "2018-06-26T16:27:30Z")

</div>

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