# Trying to upload data via bulk apis as per tutorial- not working

**URL:** <https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072>\
**Category:** Elasticsearch\
**Created:** [April 30, 2018, 10:09pm UTC](https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072 "2018-04-30T22:09:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbradley](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@rbradley](https://discuss.elastic.co/u/rbradley)\
**Post date:** [April 30, 2018, 10:09pm UTC](https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072/1 "2018-04-30T22:09:58Z")

</div>

as per this tutorial: [https://www.elastic.co/guide/en/kibana/6.x/tutorial-load-dataset.html](https://www.elastic.co/guide/en/kibana/6.x/tutorial-load-dataset.html)

I am trying to upload data from downloaded files in bulk using the following links but it isnt working

**curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/bank/account/\_bulk?pretty' --data-binary @accounts.json**  
**curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/\_bulk?pretty' --data-binary @shakespeare\_6.0.json**  
**curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/\_bulk?pretty' --data-binary @logs.jsonl**

if i copy paste the 'CURL text' in kibana console i get this error

 ![shakespear%20error](https://us1.discourse-cdn.com/elastic/original/3X/c/7/c77130ac27fbca323b06585fbc5f3e30e1f38d1f.JPG)

---

<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:** [May 1, 2018, 5:06am UTC](https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072/2 "2018-05-01T05:06:29Z")

</div>

Kibana can not access your files. You can't do that in Kibana. But you can copy and paste the file content in Kibana console under the POST \_bulk call and that should work.

---

<div class="post-metadata">

**Author:** ![rbradley](https://avatars.discourse-cdn.com/v4/letter/r/b9e5f3/32.png) [@rbradley](https://discuss.elastic.co/u/rbradley)\
**Post date:** [May 8, 2018, 8:55pm UTC](https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072/3 "2018-05-08T20:55:06Z")

</div>

I managed to do it via the console but only 1 record at a time. perhaps the documentation can be updated to reflect the correct info for first timers like me. regarding file uploads, i still cant - will try and request my other more tech team members' help. Thanks!

POST \_bulk  
{"index":{"\_index":"shakespeare", "\_type" : "doc", "\_id":4}}  
{"type":"line","line\_id":5,"play\_name":"Henry IV","speech\_number":1,"line\_number":"1.1.2","speaker":"KING HENRY IV","text\_entry":"Find we a time for frighted peace to pant,"}  
{ "update" : {"\_id" : "4", "\_type" : "doc", "\_index" : "shakespeare"} }

---

<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 5, 2018, 9:04pm UTC](https://discuss.elastic.co/t/trying-to-upload-data-via-bulk-apis-as-per-tutorial-not-working/130072/4 "2018-06-05T21:04:34Z")

</div>

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