# Bulk upload folder of json

**URL:** <https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632>\
**Category:** Elasticsearch\
**Created:** [April 7, 2017, 3:14pm UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632 "2017-04-07T15:14:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmrychl](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@kmrychl](https://discuss.elastic.co/u/kmrychl)\
**Post date:** [April 7, 2017, 3:14pm UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/1 "2017-04-07T15:14:52Z")

</div>

Apologies if this is out there, but I can't seem to figure it out. I have a folder called 'data' that consists of 10,000 geo json files.

I want to be able to upload the entire folder at once. I've tried  
`curl -XPOST "http://localhost:9200/customer/customer/1/_bulk" --data-binary "@data"`

But this gives me:

```
Warning: Couldn't read data from file "data", this makes an empty
Warning: POST.
No handler found for uri [/customer/customer/1/_bulk] and method [POST]
```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 8, 2017, 11:09pm UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/2 "2017-04-08T23:09:19Z")

</div>

You won't be able to do that, you will need to concatenate the files together and make sure they have the correct bulk format.

It'd be easier to just do a for loop 🙂

---

<div class="post-metadata">

**Author:** ![kmrychl](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@kmrychl](https://discuss.elastic.co/u/kmrychl)\
**Post date:** [April 9, 2017, 2:21am UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/3 "2017-04-09T02:21:25Z")

</div>

ok so next step, figure out how to loop over my files. Could I do a python loop over the folder and then have the ".json" file go in right after the @ symbol? Or, is there a better method. I know of things like pycurl?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 9, 2017, 2:40am UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/4 "2017-04-09T02:40:28Z")

</div>

I'd use bash personally, but whatever you want!

---

<div class="post-metadata">

**Author:** ![kmrychl](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@kmrychl](https://discuss.elastic.co/u/kmrychl)\
**Post date:** [April 9, 2017, 2:52am UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/5 "2017-04-09T02:52:16Z")

</div>

Ok Thanks for suggestion, I'm new to this, so will look into using bash, appreciate it

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 9, 2017, 2:57am UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/6 "2017-04-09T02:57:39Z")

</div>

You could use Logstash as well 🙂

---

<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:** [May 7, 2017, 3:08am UTC](https://discuss.elastic.co/t/bulk-upload-folder-of-json/81632/7 "2017-05-07T03:08:59Z")

</div>

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