Newbie to Rest API and elastic cloud here trying to post my json file in the elasticsearch so I can then index and see it in the kibana. So I read online of the library of elasticsearch and I followed its example basically to the letter. But yet I am getting a connection error when I try and run the thing. Now, the tutorial is refering to on-prem elastic and not cloud so I am guessing the authentication isn't the same for cloud and I should add the user and password somehow to this? Can anyone help me with that?
Do note, when I try to use get I actually get the code 200 so communications should be fine
es = Elasticsearch([{'host': 'https:/cloudhosturl', 'port': 9243}])
for i,line in enumerate(emails):
for match in re.finditer(from_pat, line):
ioc.append(match.group(1))
es.index(index='senders', doc_type='addresses', id=k, body=json.dumps(match.group(1)))
elasticsearch.exceptions.ConnectionError: ConnectionError(: Failed to establish a new connection: [Errno 11001] getaddrinfo failed) caused by: NewConnectionError(: Failed to establish a new connection: [Errno 11001] getaddrinfo failed)