Logstash grok filter with if statements -


i having trouble using if statements along grok filter in order filter log data.

example of code:

.conf file

input {     stdin { } }  filter {     grok {         patterns_dir => ["./patterns"]          match => {"message" => "%{api_call}"}     }     if "_grokparsefailure" not in [tags] {         grok {             add_tag => ["external api call"]         }     } }  output {     stdout { codec => rubydebug } } 

custom patterns

api_call called 

if run configuration , give input string of called grokparsefailure. if rid of if statement block , run again, have successful match.

all appreciated.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -