I have logs coming in from coreos nodes via filebeat, the "source" field is of the general form: /var/log/containers/<name of container>-<some alphanumeric string I don't care about>
I'd like to parse the part after /var/log/containers/, and have found that the regex ^(\w+\b-\w+\b) should pull out the part I need. I have put this into a file in the pattern_dir.
So my grok filter currently looks like this:
filter {
grok {
match => { "source" => "%{GREEDYDATA}/%{CONTAINERAPP:app}*" }
patterns_dir => ["/patterns"]
}
}
The patterns directory has the a file "containerlogs" containing:
CONTAINERAPP ^(\w+\b-\w+\b)
...but I currently don't even see an "app" field. According to logstash's output, it seems happy with this pattern.
Can anybody point me in the right direction?