Hello,
Is it possible to define a global patterns_dir for all cases in filter or it must be defined in each grok section.
Se below:
if ("xxx" in [path]) {
grok {
**patterns_dir => [ "/usr/share/logstash/patterns" ]**
match => { "message" => "^%{TIMESTAMP_ISO8601:timestamp}\;%{LOGLEVEL:loglevel}(.*);%{OPTIONALUSERNAME:user};%{TNR:tnr};%{INTEGRATION:integration};%{THREAD:thread};%{WORD:classname};%{GREEDYDATA:logmessage}$" }
add_field => [ "logtype", "xxx" ]
}
}
if ("yyy" in [path]) {
grok {
**patterns_dir => [ "/usr/share/logstash/patterns" ]**
match => { "message" => "^%{TIMESTAMP_ISO8601:timestamp}\;%{LOGLEVEL:loglevel}(.*);%{OPTIONALUSERNAME:user};%{TNR:tnr};%{INTEGRATION:integration};%{THREAD:thread};%{WORD:classname};%{GREEDYDATA:logmessage}$" }
add_field => [ "logtype", "yyy" ]
}
}