Hi!
I am struggling with syslog from one of our vendors (F5). When something goes down a syslog message is sent with the thing that has failed together with the last states of the monitor.
Two sample log lines could look like this:
<182>Feb 2 03:31:01 OurLoadbalancerHostName notice mcpd[6728]: 01070638:5: Pool /Common/my_pool_http_pool member /Common/10.10.10.1:80 monitor status down. [ /Common/my_pool_http_monitor: down; last error: /Common/my_pool_http_monitor: Host is unreachable.; Unable to connect; Response Code: 200 (OK); No successful responses received before deadline. @2019/02/03 02:00:22. ] [ was up for 23hrs:59mins:55sec ]\r\n
<182>Feb 2 03:31:01 OurLoadbalancerHostName notice mcpd[6728]: 01070638:5: Pool /Common/my_pool_http_pool member /Common/10.10.10.1:80 monitor status down. [ /Common/my_pool_http_monitor: down; last error: /Common/my_pool_http_monitor: Host is unreachable.; Could not connect.; No successful responses received before deadline. @2019/02/02 03:31:01. ] [ was up for 23hrs:55mins:22sec ]\r\n
My config looks like this:
input {
syslog {
port => 5044
}
}
filter {
if [severity_label] != "Informational" {
drop { }
} else {
if ([message] =~ "monitor status down") {
grok {
break_on_match => false
match => {
"message" => [
"Pool (?<pool>[^ ]+) member (?<member>[^ ]+) monitor status (?<status>[^ ]+) \[ (?<monitor>[^ ]+): .+; last error: (?<last_error>[^\]]+)",
"(?<failure_reason>[cC]onnection refused)",
"(?<failure_reason>Could not connect)",
"(?<failure_reason>Unable to connect)",
"(?<failure_reason>Response Code: [0-9]+)"
]
}
}
} else {
drop { }
}
}
}
output {
stdout { codec => rubydebug }
}
This seems to work quite well for the first line, but the second line gets a "_grokparsefailure" and I am not sure why?
Since I'm a novice logstash administrator I'd also like to get a second opinion on it there is a better way to structure the config file to get multiple matches in an array?
Example array of failure_reason:
"failure_reason" => [
[0] "Unable to connect",
[1] "Response Code: 200"
]
Please ignore the drop clauses, they are just there to filter out the particular events I wanted to parse to begin with.
Thankful for any advice,
Patrik