pglogwatcher service for linux systems
- process postgresql logs in csv format
- convert csv lines into json in different file
- json namespace is compatible with elastic stack
- rollover; keeps track of new csv file, rollover when needed
- online; tails csv file and process new csv lines
- duration; extract duration value as a json key
- summarizes; follow session and merges parse-bind-command-command csv line into one json line with extra duration parameters.
- virtual session; adds virtual session paramter, 'discard all' increases virtual session id
- telnet terminal to monitor
- Only for linux systems
- Download and extract pglogwatcher-install.tar.gz
- Run install.sh in pglogwatcher directory
- Service is ready start, before starting let's configure
- Service runs with postgres user
In postgresql.conf
log_filename = 'postgresql-%Y-%m-%d_%H_%M_%S'
log_destination = 'csvlog'
log_line_prefix = ''
log_directory = '/xxx/log/'
In /etc/pglogwatcher.ini
[dir-1]
path=/xxx/log
systemctl start pglogwatcher.service
systemctl enable pglogwatcher.service
systemctl status pglogwatcher.service
log file /var/log/pglogwatcher/pglogwatcher.log
>telnet 127.0.0.1 2300
>status
>exit
1.2.0 unix_socket added to json. If client_connection came as [local] client.ip will be null and unix_socket will be true