From f0d9e4cef9729b4c4c67b90960829601440c1f8a Mon Sep 17 00:00:00 2001 From: Kaarel Moppel Date: Thu, 16 Jan 2020 16:48:42 +0200 Subject: [PATCH] Sample YAML config for log parsing + README update on same topic --- README.md | 4 +++- pgwatch2/config/instances.yaml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5963021a..31f85672 100644 --- a/README.md +++ b/README.md @@ -375,7 +375,9 @@ formats user needs to specify a regex that parses out as a named group following See [here](https://github.com/cybertec-postgresql/pgwatch2/blob/master/pgwatch2/logparse.go#L27) for an example regex. NB! Note that only the event counts are stored, by severity, for the monitored DB and for the whole instance - no error -texts or username infos! The metric name to enable log parsing is "server_log_event_counts". +texts or username infos! The metric name to enable log parsing is "server_log_event_counts". Also note that for auto-detection +of log destination / setting to work the monitoring user needs superuser / pg_monitor rights - if this is not possible +then log settings need to be specified manually under "Host config" as seen for example [here](https://github.com/cybertec-postgresql/pgwatch2/blob/master/pgwatch2/config/instances.yaml). # Adding metrics diff --git a/pgwatch2/config/instances.yaml b/pgwatch2/config/instances.yaml index 6434832d..a700f77c 100644 --- a/pgwatch2/config/instances.yaml +++ b/pgwatch2/config/instances.yaml @@ -40,6 +40,8 @@ ca_file: cert_file: cert_key: + logs_glob_path: "/tmp/*.csv" + logs_match_regex: ^(?P.*?),"?(?P.*?)"?,"?(?P.*?)"?,(?P\d+),"?(?P.*?)"?,(?P.*?),(?P\d+),"?(?P.*?)"?,(?P.*?),(?P.*?),(?P.*?),(?P\w+), stmt_timeout: 5 preset_metrics: custom_metrics: