# Pushing data through python to elastic search

**URL:** <https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489>\
**Category:** Elasticsearch\
**Created:** [September 29, 2022, 5:36pm UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489 "2022-09-29T17:36:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashank02/32/99866_2.png) [@Shashank02](https://discuss.elastic.co/u/Shashank02)\
**Post date:** [September 29, 2022, 5:36pm UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/1 "2022-09-29T17:36:07Z")

</div>

I'm trying to push some data that I've collected through Python into Elasticsearch but it's showing this error:- "ValueError: Can't specify the options 'http\_auth' via a dictionary in 'hosts', only 'host', 'path\_prefix', 'port', 'scheme', 'url\_prefix', 'use\_ssl' options are allowed"  
Can someone help me through this!

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [September 29, 2022, 6:29pm UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/2 "2022-09-29T18:29:13Z")

</div>

Using python dsl, this is a working format:

```auto
client = Elasticsearch(
        ['https://somehost:9200'],
        http_auth=(user,pw),ca_certs="super.cer")

```

data is in es\_out dictionary

```auto
index = bulk(client, es_out)

```

---

<div class="post-metadata">

**Author:** ![Shashank02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashank02/32/99866_2.png) [@Shashank02](https://discuss.elastic.co/u/Shashank02)\
**Post date:** [September 30, 2022, 4:51am UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/3 "2022-09-30T04:51:53Z")

</div>

Thank You for the response. I'll try it out!!

---

<div class="post-metadata">

**Author:** ![Shashank02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashank02/32/99866_2.png) [@Shashank02](https://discuss.elastic.co/u/Shashank02)\
**Post date:** [September 30, 2022, 5:18am UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/4 "2022-09-30T05:18:03Z")

</div>

Now, it's showing this error :elastic\_transport.ConnectionTimeout: Connection timed out

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [September 30, 2022, 7:14pm UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/5 "2022-09-30T19:14:04Z")

</div>

Test connectivity with curl, that probably means "you can't get there"

---

<div class="post-metadata">

**Author:** ![Shashank02](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shashank02/32/99866_2.png) [@Shashank02](https://discuss.elastic.co/u/Shashank02)\
**Post date:** [October 1, 2022, 11:01am UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/6 "2022-10-01T11:01:04Z")

</div>

Well, I'm new to all this, so I don't understand what you're trying to tell. Can you please state it in detail if possible?

---

<div class="post-metadata">

**Author:** ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)\
**Post date:** [October 2, 2022, 3:06am UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/7 "2022-10-02T03:06:33Z")

</div>

The error looks like you can't connect to your elastic stack on port 9200. Curl is the standard test, removing all other API complications. Can you talk to your stack?

---

<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:** [October 30, 2022, 3:06am UTC](https://discuss.elastic.co/t/pushing-data-through-python-to-elastic-search/315489/8 "2022-10-30T03:06:35Z")

</div>

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