Hi all,
I have a weird timestamp problem and maybe someone can help on this:
The PostgreSQL logs are in CSV format and I get a fixed date string from Postgres with CEST at the end.
How do I need to set the timestamp expression in the date filter to catch/accept CEST?
An example log message:
2015-08-21 17:02:22.753 CEST,"demo","demo",18372,"XXX.XXX.YYY.ZZZ:51716",55d73c07.47c4,3,"idle",2015-08-21 16:56:07 CEST,,0,LOG,00000,"Verbindungsende: Sitzungszeit: 0:06:15.000 Benutzer=demo Datenbank=demo Host=XXX.XXX.YYY.YYY port=51716",,,,,,,,,""
An example error message from Logstash (does not correspond to the message above but it would have the same meaning):
{:timestamp=>"2015-08-21T16:41:02.152000+0200", :message=>"Failed parsing date from field", :field=>"timestamp", :value=>"2015-08-21 16:41:01.373 CEST", :exception=>"Invalid format: "2015-08-21 16:41:01.373 CEST" is malformed at "CEST"", :config_parsers=>"YYYY-MM-DD HH:mm:ss.SSS z", :config_locale=>"default=en_US", :level=>:warn}
The corresponding logstash.conf snippet:
...
filter {
...
if [type] =~ "postgres" {
csv {
columns => [ "timestamp", "postgres_username", "postgres_databasename", "postgres_process_id", "postgres_connection_from", "postgres_session_id", "postgres_session_line_number", "postgres_command_tag", "postgres_session_start_time", "postgres_virtual_transaction_id", "postgres_transaction_id", "postgres_error_severity", "postgres_sql_state_code", "postgres_message", "postgres_detail", "postgres_hint", "postgres_internal_query", "postgres_internal_query_pos", "postgres_context", "postgres_query", "postgres_query_pos", "postgres_location", "postgres_application_name" ]
}
date {
match => [ "timestamp", "YYYY-MM-DD HH:mm:ss.SSS z" ]
}
}
...
Thx in advance,
Michael