Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
hackerss
hackerss

Posted on

Python Connect to elasticsearch


import elasticsearch
import certifi

# create connection to elasticsearch
es = elasticsearch.Elasticsearch(
    ['atlas-kibana.mwt2.org:9200'],
    http_auth=('atlas', 'atlas'),
    scheme="https",
    port=9200,
    ca_certs=certifi.where(),
)

# get all indices
indices = es.indices.get_alias("*")

# print indices
for index in indices:
    print(index)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)