Yelp / elastalert

Easy & Flexible Alerting With ElasticSearch
https://elastalert.readthedocs.org
Apache License 2.0
8k stars 1.73k forks source link

KeyError: 'agent' when added custom elastalert rule #3272

Closed utkarshborawake closed 2 years ago

utkarshborawake commented 2 years ago

The custom elastalert rule is mentioned below. I am getting hits and matches for the rule but at the same time getting the error which is mentioned below the rule.

RULE --> ACDS_cve_id: '' confidence: 90 description: This alert will trigger when Open VPN user is trying to login with invalid passwords. alert:

ERROR --> Traceback (most recent call last):, File "/usr/local/lib/python3.10/site-packages/elastalert/elastalert.py", line 1298, in alert, return self.send_alert(matches, rule, alert_time=alert_time, retried=retried), File "/usr/local/lib/python3.10/site-packages/elastalert/elastalert.py", line 1375, in send_alert, alert.alert(matches), File "/opt/elastalert/modules/custom/ACDS_alerter.py", line 47, in alert, hostname = match["agent"]["name"], KeyError: 'agent'

ksnip_20221121-181530

nsano-rururu commented 2 years ago

elastalert is not maintained. Please use elastalert2. https://github.com/jertel/elastalert2/discussions

utkarshborawake commented 2 years ago

Okay Thanks