Connecting Elastic search cloud with Jupiter notebook

Hi all,
I am getting trouble with connecting to the elastic cloud with the following code through Jupyter notebook:

es = Elasticsearch(["https://xxxxxxxxxxxxxxxx.us-west-1.aws.found.io:9243/"])
es.info(pretty=True) => throws  following ERROR message
AuthenticationException: TransportError(401, 'security_exception', 'action [cluster:monitor/main] requires authentication')

Any help would be appreciated.

You need to specify authentication details - https://elasticsearch-py.readthedocs.io/en/master/#ssl-and-authentication

Thank you Mark!
This worked. I did the following:

es = Elasticsearch(
    [login["remote_host"]],
    http_auth=(login["user"],login["password"]),
    scheme="https",
    port=443,
)

It is going awesome now!

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