-
Given this sample yaml file below, I'm curious how to get various key/values/arrays into the elastalert as new fields. For example, name maps to rule_name description maps to description, elastic query results map to match_body... but what about fields defined in the yaml that I'd like to push forward into the alert. For example, status, severity, references, and mitre? I had the thought of modifying the elastaery.py self.add_metadata_alert and ruletypes.py init sections but that felt dirty to insert like that. Is this something I'd leverage a custom rule type for to insert this additional data using add_data? I've done some amount of searching, but I can't find other references to this. I've found some references to using this data in the alert_text, but I want to get it stored with the document.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I'm not following. If you want to push static data, like you have in the rule above (ex: status = stable) why wouldn't you just type that into the alert_text value. Ex:
|
Beta Was this translation helpful? Give feedback.
I see. You can add an enhancement to grab those params out of the
rule
dict, and push them into thematch
dictionary. That match dictionary is what lands inside thematch_body.*
fields, stored in theelastalert
index.Ex:
My Rule:
My Custom Enhancement, placed in a new file
mod/test.py