# Bulk insert API with json file not working

**URL:** <https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522>\
**Category:** Elasticsearch\
**Created:** [December 19, 2019, 4:40pm UTC](https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522 "2019-12-19T16:40:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [December 19, 2019, 4:40pm UTC](https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522/1 "2019-12-19T16:40:28Z")

</div>

Hi, I have a very large file with like 1 million records or 1,000,000 records (either way its a lot :D)

I am using the curl command:  
$ curl -s -H "Content-Type: application/json" -XPOST localhost:9200/\_bulk --data-binary @assets-latest.json

The cursor blinks a bit in my terminal (like 2seconds), then just disappears and nothing happens. When I make a POSTMAN API "GET" request, I get 0 hits. Checking on the Kibana console for that specific index, "assets", returns nothing aswell.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 19, 2019, 4:53pm UTC](https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522/2 "2019-12-19T16:53:27Z")

</div>

It's probably not going to work.

Few things:

1. does your json file respect the expected BULK specific format (header+content)?
2. how big is the file (in mb)?

I'd recommend anyway to send smaller bulk requests, like 10000 per 10000 items.

---

<div class="post-metadata">

**Author:** ![apizano](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@apizano](https://discuss.elastic.co/u/apizano)\
**Post date:** [December 19, 2019, 8:07pm UTC](https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522/3 "2019-12-19T20:07:25Z")

</div>

OK thank you. I found that one of our developers here our company wrote a shell script to remap/transform the JSON for a format to be ingested into Elasticsearch.

Thank you for the response.

---

<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:** [January 16, 2020, 8:13pm UTC](https://discuss.elastic.co/t/bulk-insert-api-with-json-file-not-working/212522/4 "2020-01-16T20:13:50Z")

</div>

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