Skip to content
This repository was archived by the owner on Sep 27, 2022. It is now read-only.
This repository was archived by the owner on Sep 27, 2022. It is now read-only.

Alerting fails if there's an empty field in the alert #10

@nickbabkin

Description

@nickbabkin

Currently, if one of the specified fields is not present in elastalert {match}, TheHive alerter fails with KeyError.

Example config sample:

hive_alert_config:
  description: '{match[clientip]}'

Test run:
elastalert_error - {'message': "Uncaught exception running rule --: 'clientip'", 'traceback': ['Traceback (most recent call last):', ' File "/usr/local/lib/python3.5/dist-packages/elastalert-0.2.1-py3.5.egg/elastalert/elastalert.py", line 1444, in alert', ' return self.send_alert(matches, rule, alert_time=alert_time, retried=retried)', ' File "/usr/local/lib/python3.5/dist-packages/elastalert-0.2.1-py3.5.egg/elastalert/elastalert.py", line 1533, in send_alert', ' alert.alert(matches)', ' File "/usr/local/lib/python3.5/dist-packages/elastalert-0.2.1-py3.5.egg/elastalert/alerts.py", line 2154, in alert', ' alert_config[alert_config_field] = alert_config_value.format(**context)', "KeyError: 'clientip'"], 'data': {'rule': '--'}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions