I have tried to set the es_host and es_port both using the config file and passing --config to elastalert-create-index and I have tried feeding the host and port to the elastalert-create-index cli, and both times I get the following error:
Traceback (most recent call last):
File "/usr/bin/elastalert-create-index", line 11, in <module>
load_entry_point('elastalert==0.1.38', 'console_scripts', 'elastalert-create-index')()
File "/usr/lib/python2.7/site-packages/elastalert/create_index.py", line 129, in main
esversion = es.info()["version"]["number"]
File "/usr/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 76, in _wrapped
return func(*args, params=params, **kwargs)
File "/usr/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 241, in info
return self.transport.perform_request('GET', '/', params=params)
File "/usr/lib/python2.7/site-packages/elasticsearch/transport.py", line 318, in perform_request
status, headers_response, data = connection.perform_request(method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
File "/usr/lib/python2.7/site-packages/elasticsearch/connection/http_requests.py", line 85, in perform_request
raise ConnectionError('N/A', str(e), e)
elasticsearch.exceptions.ConnectionError: ConnectionError(HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //vpc-****************************-east-1.es.amazonaws.com:443/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3f8ab43450>: Failed to establish a new connection: [Errno -2] Name or service not known',))) caused by: ConnectionError(HTTPConnectionPool(host='https', port=80): Max retries exceeded with url: //vpc-****************************-east-1.es.amazonaws.com:443 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3f8ab43450>: Failed to establish a new connection: [Errno -2] Name or service not known',)))
I am confused why it is setting the host to 'https' and port to '80' at the HTTPConnectionPool function, because I explicitly set the host to the aws elasticsearch host and the port to 443. It seems like it's breaking the host url up and mistakenly setting it as 'https' while the url is being set to the rest of the host url. And I'm not sure why the port is being set to 80 because this is incorrect and not the port I provided. I can successfully curl the elasticsearch host.
Don't include https:// in the es_host settings. That should only include the hostname. IE: vpc-****************************-east-1.es.amazonaws.com. es_port is where you'd set 443 as well, and use_ssl: true.
@Qmando this worked, thank you!
Most helpful comment
Don't include
https://in thees_hostsettings. That should only include the hostname. IE:vpc-****************************-east-1.es.amazonaws.com. es_port is where you'd set 443 as well, anduse_ssl: true.