Skip to content

Commit

Permalink
Use CustomAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
frack113 committed Nov 12, 2024
1 parent 94be3a2 commit ee0300c
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions elastalert/elastalert_any_v4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#Set the index from logsource
transformations:
- id: index_windows
type: set_custom_attribute
attribute: "es_index"
value: "winlogbeat-*"
rule_conditions:
- type: logsource
product: windows
- id: index_linux
type: set_custom_attribute
attribute: "es_index"
value: "linux-*"
rule_conditions:
- type: logsource
product: linux

#The elastalert template
postprocessing:
- type: template
template: |+
name: '{{ rule.id }}'
description: '{{ rule.title }}'
owner: '{{ rule.author }}'
type: any
priority:{% set priority = ({"critical":4, "high":3, "medium":2, "low":1, "informational":0 })%} {{ priority["%s" % rule.level]}}
alert:
- debug
index: {% if rule.custom_attributes.es_index is defined %}{{ rule.custom_attributes.es_index }}{% else %}log-*{% endif %}
filter:
- query:
query_string:
query: ({{ query }})
finalizers:
- type: concat

0 comments on commit ee0300c

Please sign in to comment.