# How to upload data to elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-upload-data-to-elasticsearch/141135>\
**Category:** Elasticsearch\
**Created:** [July 23, 2018, 9:59am UTC](https://discuss.elastic.co/t/how-to-upload-data-to-elasticsearch/141135 "2018-07-23T09:59:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yolo\_1900](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yolo_1900/32/32877_2.png) [@yolo\_1900](https://discuss.elastic.co/u/yolo_1900)\
**Post date:** [July 23, 2018, 9:59am UTC](https://discuss.elastic.co/t/how-to-upload-data-to-elasticsearch/141135/1 "2018-07-23T09:59:20Z")

</div>

Hello everyone,

I am trying to upload the data to elasticsearch using `helpers.bulk`

```auto
from elasticsearch import Elasticsearch, helpers
data = []
my_data = {"_index": ES_INDEX.format(strftime("%Y.%m.%d", gmtime())),
                                 "_type": type,
                                 "_source": res_json}
data.append (my_data)
helpers.bulk(es, adds_diag)

```

and I have the error:  
`BrokenPipeError: [Errno 32] Broken pipe`

I am quite new to elasticsearch and could not figure out what is the problem.

Might you suggest me some possible causes for the issue?

Thanks

---

<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:** [August 20, 2018, 9:59am UTC](https://discuss.elastic.co/t/how-to-upload-data-to-elasticsearch/141135/2 "2018-08-20T09:59:31Z")

</div>

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