elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Sending email alert for each hit

Open kernelpanicfbsd opened this issue 9 years ago • 2 comments

Hello, I've configured Elastalert to e-mail me whenever some one is added to a group in AD; I've configured Elastalert to sleep for 1 minutes and query the previous 5 minutes.

My test rule is as below:

name: Test ElastAlert Rule
es_host: 192.168.1.1
es_port: 9200
index: winlogbeat-*
filter:
  - term:
      event_id: "4728"
include:
 - event_data.TargetUserName
 - event_data.MemberName
 - event_data.SubjectUserName
type: any
timeframe:
  minutes: 5
alert:
  - "email"
email: "admin@domain"
smtp_host: "192.168.1.2"
from_addr: "ElastAlert@domain"

I was expecting to receive an email alert for every group that was modified, however I've noticed that when I modify two groups whilst Elastalert is sleeping, it will only send one e-mail with only the details of one of the groups - however it does see that there were two hits, as below:

Test ElastAlert Rule

@timestamp: 2017-04-21T14:18:52.823Z
_id: AVuQ4UG3ZFqcPo9Ha8O1
_index: winlogbeat-2017.04
_type: wineventlog
event_data: {
    "MemberName": "CN=Test user,OU=Users, DC=domain", 
    "SubjectUserName": "admin", 
    "TargetUserName": "Group-1"
}
num_hits: 2
num_matches: 2

As far as I can see I haven't enabled any aggregation - I would like to receive an e-mail for every group that is modified, can anyone help?

Thanks.

kernelpanicfbsd avatar Apr 21 '17 14:04 kernelpanicfbsd

Just RTFM'd the option I need is:

realert:
  minutes: 0

Apologies for the noise again :)

kernelpanicfbsd avatar Apr 21 '17 15:04 kernelpanicfbsd

can you please tell where you put below entry to get every alert

realert: minutes: 0

Ankit-github-26 avatar Apr 22 '20 22:04 Ankit-github-26