I imagine this may be a trivial question but since it is my early days with GROK patterns I want to makes sure. I created a custom GROK pattern for my environment and it works fine: my filter file looks for a presence of specific string in the tags field of the events that arrive to Logstash:
filter {
if [tags] {
grok {
patterns_dir => ["/etc/logstash/patterns"]
match => {
"tags" => "%{INDEX_TAG:es_prefix}"
}
}
}
If there is no value matching the INDEX_TAG pattern in my event's tags filed, will that automatically append _grokparsefailure to the tags field?
If you try to match against tags then it will iterate over the entire array and if there are multiple matches it will return an array of values. Patterns are not anchored by default, so
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.