Hi,
I downloaded elastalert. I am trying to run
elastalert-test-rule example_rules/lasya_rule.yaml --data data.json
(The rule and data.json are same as the ones mentioned in issue 261
https://github.com/Yelp/elastalert/pull/261 )
I get the error
WARNING:elasticsearch:GET http://es:14900/ [status:N/A request:0.004s]
Traceback (most recent call last):
File "build/bdist.macosx-10.10-x86_64/egg/elasticsearch/connection/http_requests.py", line 68, in perform_request
response = self.session.request(method, url, data=body, timeout=timeout or self.timeout)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, *send_kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, *kwargs)
File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='es', port=14900): Max retries exceeded with url: / (Caused by NewConnectionError('
Why am I getting ConnectionError even though I am running locally
Hello,
what was the solution? @laasya19
The solution was adding --config config.yaml
Please provide the example of config.yaml
@Qmando can you elaborate a bit. I'm new to both ES and ElastAlert. I'm getting the same error
You must either pass --config argument to elastalert-test-rule, or have a file named config.yaml in the same directory. In that config file, you must specify the elasticsearch hostname (es_host) and port (es_port). ElastAlert will attempt to connect to that. If you see HTTPConnectionPool(host='localhost', port=14900), you haven't set it, and it's trying localhost:14900 by default.
Most helpful comment
The solution was adding
--config config.yaml