Yelp / elastalert

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

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

Closed utkarshborawake closed 1 year ago

utkarshborawake commented 1 year 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 1 year ago

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

utkarshborawake commented 1 year ago

Okay Thanks