if [message] {
if [type] == "jboss" {
Equivalent:
if [message] and [type] == "jboss" {
grok {
add_field => { "level" => "%{level}" }
}
I've seen people make this exact mistake a few times before. What made you add this?
Example line that isn't generating the level field.
Works just fine:
$ cat test.config
input { stdin {} }
output { stdout { codec => rubydebug } }
filter {
grok {
match => ["message", "%{TIME:time} %{WORD:level} .*"]
}
}
$ echo '10:23:09,766 INFO [stdout] (Curator-TreeCache-0) Listen: Update path: /realtime/subscriptions/network/160072/160072/TLOC, timestamp is: 1472836989577' | logstash -f test.config
Settings: Default pipeline workers: 8
Pipeline main started
{
"message" => "10:23:09,766 INFO [stdout] (Curator-TreeCache-0) Listen: Update path: /realtime/subscriptions/network/160072/160072/TLOC, timestamp is: 1472836989577",
"@version" => "1",
"@timestamp" => "2016-09-03T15:35:47.428Z",
"host" => "bertie",
"time" => "10:23:09,766",
"level" => "INFO"
}
Pipeline main has been shutdown
stopping pipeline {:id=>"main"}