I'm using the following config to have fluentd read the auth.logs and send it to elastic search but i'm faced with an error saying pattern doesn't match and the logs are not pushed to ES.
I'm using the pattern defined in fluentd syslog parser plugin rfc3164-pattern
<source>
@type tail
path /var/log/auth.log
pos_file /var/log/auth.pos
format /^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\]) *(?<message>.*)$/
tag authlog
</source>
<match authlog.**>
@type elasticsearch
hosts "ESHOST:PORT"
logstash_format true
logstash_prefix "server-authlogs"
include_tag_key true
flush_interval 5s
logstash_dateformat %Y.%m.%d
time_precision 3
</match>
Output Error:
2019-04-16 08:00:50 +0000 [warn]: #0 pattern not match: "Apr 16 08:00:50 hostname-1415 sshd[15134]: pam_unix(sshd:session): session opened for user ubuntu by (uid=0)" 2019-04-16 08:00:50 +0000 [warn]: #0 pattern not match: "Apr 16 08:00:50 hostname-1415 systemd-logind[1138]: New session 10 of user ubuntu."