Hi!
I have the following filter in Logstash:
filter {
if [type] == "weblogic" {
multiline {
pattern => "^####"
negate => true
what => previous
}
grok {
match => {
"message" => [
'####<(?<timestamp>\w{3}\s+\d{1,2}, \d{4} \d{1,2}:\d{2}:\d{2} \w{2}) \w+> <%{DATA:severity}> <%{DATA:subsystem}> <%{DATA:machine}> <%{DATA:server}> <%{DATA:thread}> <%{DATA:user}> <%{DATA:diagnostic}> <%{DATA:transaction}> <%{DATA:raw_time}> <%{DATA:message_id}> <%{GREEDYDATA:message_text}'
]
}
keep_empty_captures => true
}
mutate {
gsub => [ "message_text", ">\s*$", ""]
}
mutate {
gsub => [ "user", "[<>]", ""]
}
mutate {
gsub => [ "thread", "[\[\]]", ""]
}
date {
match => [
"timestamp",
"MMM dd, yyyy hh:mm:ss a",
"MMM dd, yyyy h:mm:ss a",
"MMM d, yyyy hh:mm:ss a",
"MMM d, yyyy h:mm:ss a"
]
}
}
I tested it quite thoroughly with Grok Debugger app first and then even wrote a unit test (with more than 200 different log samples) for that using rspec from logstash and ran that unit test directly on the system where logstash is running. All passed.
But when logstash runs in production grok filter fails for all incoming. I take some of the failing lines and put them into unit test and unit test is passing with them. I'm stuck.
Here is an example log line:
####<Apr 19, 2016 10:57:42 AM CEST> <Info> <Security> <ncby-modd-wbl02> <> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <> <1461056262679> <BEA-000000> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
It's logstash 2.3.1.
Logstash is receiving data from filebeat 1.2.3. Could that be the reason?
Best regards,
Anndrey