Our postgre server log with timezone CST, in this case it represents China standard time.
pipeline
(module provid) will parse the log message and read timezone value use WORD
pattern, finally date processor parse the time use format yyyy-MM-dd HH:mm:ss.SSS zz
.
Eventually time was parse at timezone America/Chicago which not my expect.
What I have issue with are:
- pipeline parse timezone use
WORD
pattern this not allow other timezone format. - date processor use format
zz
which also reject other options.
So I wonder if there is any chance to parse my log time right.
filebeat.modules:
- module: postgresql
log:
enabled: true
var.paths: ["/data/pgdata/pg_log/*.log"]
input:
tags: "server"
part of pipeline
"grok": {
"field": "message",
"patterns": [
"^%{DATETIME:postgresql.log.timestamp}%{CHAR:separator}%{GREEDYDATA:raw_message}"
],
"pattern_definitions": {
"DATETIME": "[-0-9]+ %{TIME} %{WORD:event.timezone}",
"CHAR": ".",
"GREEDYDATA": "(.|\n|\t)*"
}
}
{
"date": {
"field": "postgresql.log.timestamp",
"target_field": "@timestamp",
"formats": [
"yyyy-MM-dd HH:mm:ss.SSS zz",
"yyyy-MM-dd HH:mm:ss zz"
]
}
}
Version: 7.14