As given by example
# contents of ./patterns/postfix:
POSTFIX_QUEUEID [0-9A-F]{10,11}
Raw data
Jan 1 06:25:43 mailserver14 postfix/cleanup[21403]: BEF25A72965: message-id=<20130101142543.5828399CCAF@mailserver14.example.com>
The corresponding Grok filter configuration will be:
filter {
grok {
patterns_dir => ["./patterns"]
match => { "message" => "%{SYSLOGBASE} %{POSTFIX_QUEUEID:queue_id}: %{GREEDYDATA:syslog_message}" }
}
}
Just to understand few bits
- Can the
patterns_dirbe specified "relative" to the installation directory of logstash? (eg something like$LOGSTASH_HOME/mypatterns/) - if NOT, can we specify the patterns directory in absolute terms to OS? (eg something like
/tmp/logstash/configs/patterns) ?