When I use debug as the alert this works but with Slack I get this errorr
ERROR:root:Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/elastalert-0.0.85-py2.7.egg/elastalert/elastalert.py", line 903, in alert
return self.send_alert(matches, rule, alert_time=alert_time)
File "/usr/lib/python2.7/site-packages/elastalert-0.0.85-py2.7.egg/elastalert/elastalert.py", line 976, in send_alert
alert.alert(matches)
File "/usr/lib/python2.7/site-packages/elastalert-0.0.85-py2.7.egg/elastalert/alerts.py", line 790, in alert
for url in self.slack_webhook_url:
TypeError: 'NoneType' object is not iterable
ERROR:root:Uncaught exception running rule FlatlineOSSEC: 'NoneType' object is not iterable
The config looks like this
es_host: elasticsearch.url
es_port: 9200
index: logstash-*
type: flatline
name: Flatline
threshold: 100
timeframe:
minutes: 1
alert:
- "slack"
alert_text: No incoming logs
alert_text_type: alert_text_only
slack:
slack_webhook_url: "URL"
slack_username_override: elastalert
slack_msg_color: warning
slack_emoji_override: ghost
From the error it seems to be telling me that some object that is required somewhere is empty but I have not been able to trace the source of the problem yet.
Solved, user error
slack:
slack_webhook_url: "URL"
slack_username_override: elastalert
slack_msg_color: warning
slack_emoji_override: ghost
This is correct way to write to slack.
Most helpful comment
Solved, user error
This is correct way to write to slack.