Elastalert: Alerting to slack gives TypeError: 'NoneType' object is not iterable

Created on 13 Jun 2016  路  1Comment  路  Source: Yelp/elastalert

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.

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shortstack picture shortstack  路  3Comments

otisonoza picture otisonoza  路  4Comments

JeffAshton picture JeffAshton  路  3Comments

vaibhavtupe picture vaibhavtupe  路  4Comments

tkumark picture tkumark  路  3Comments