GUnicorn uses this format for the error log file:
[2019-04-24 14:53:51 +0000] [10] [INFO] Starting gunicorn 19.4.5
[2019-04-24 14:53:51 +0000] [10] [INFO] Listening at: http://0.0.0.0:12007 (10)
Is the timestamp a standard ISO format that can be used in grok?
Currently my logstash pipeline grok filter looks like this, and it works but I'm not sure if this is the right way to do it. I'm parsing thetime
out as just DATA
and then using date
plugin:
else if "gunicorn" in [tags] {
grok {
match => [ "message", "(?m)\[%{DATA:thetime}\] \[%{DATA:pid}\] \[%{LOGLEVEL:level}\] %{GREEDYDATA:event}" ]
}
date {
locale => "en"
match => ["thetime", "YYYY-MM-dd HH:mm:ss Z"]
timezone => "UTC"
}
}
If this is ok then I'll leave it as-is, but it would be good to know what others would do.