-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter-80-object.conf
30 lines (29 loc) · 1 KB
/
filter-80-object.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# The object field contains names of monitored objects or related objects like downtimes
# Syntax: hostname!servicename!objectname where host objects only have the first part
# and service names only have the first two parts
#
# Do not use host.name from ECS because this is already in use for the host writing
# the log.
filter {
if [icinga][object] {
mutate {
add_field => {
"[icinga][host]" => "%{[icinga][object]}"
}
}
if [icinga][host] =~ /!/ {
grok {
match => ["[icinga][host]","%{DATA:[icinga][host]}!%{GREEDYDATA:[icinga][service]}"]
tag_on_failure => ["_grokparsefailure","servicename_from_object_failed"]
overwrite => "[icinga][host]"
}
if [icinga][service] =~ /!/ {
grok {
match => ["[icinga][service]","%{DATA:[icinga][service]}!%{GREEDYDATA:[icinga][objectid]}"]
tag_on_failure => ["_grokparsefailure","object_id_from_service_failed"]
overwrite => "[icinga][service]"
}
}
}
}
}