Hi,
I'm new to Logstash,I'm trying to split the hostname into new fields like the below example
hostname = gbldi-f01-switch split to the below fields
SITE_ID = gbldi
FLOOR = f01
CATEGORY = switch
Please see the below logstash conf and how to fix this?
mutate {
copy => {
"[host][shortname]" => "SITE_CODE"
}
}
mutate {
split => [ "SITE_CODE", "-" ]
}
mutate {
replace => ["SITE_CODE", "%{[host][shortname][0]}"]
}
mutate {
add_field => { "FLOOR" => "%{[host][shortname]}" }
}
mutate {
split => ["FLOOR", "-"]
}
mutate {
replace => ["FLOOR", "%{[host][shortname][1]}"]
}
Thanks
Gowtham