Inactive Users(Postgres)

Please watch video youtube.com/watch?v=BXx1vCRmRlQ or follow below instructions

There are two ways to run it 1) Interactive mode 2) Commandline mode

1) Interactive mode

You can pick option for Inactive user report a(as shown below). You also need to give your log_line_prefix(You can run 'show log_line_prefix' command on your server to get the current prefix on your server). You can also give a specific timerange or wild card for your logfiles e.g 'postgresql-2024-03-11_12*.log' (NOTE - You need to embed it in single quotes for wildcards)

NOTE - Scanning a large number of files may take a considerable amount of time. To expedite the process, please narrow your search to a specific time range or use wildcards to target a subset of log files

2) Commandline mode

Below is the sample command , Please replace logfile location and prefix

ciscollector --logparser inactive_users --file-path /var/lib/postgresql/14/main/log/postgresql-2024-03-11_120824.log --prefix pid=%p,user=%u,db=%d,app=%a,client=%h

When you have lot of files you can give wildcards - Example below

ciscollector --logparser inactive_users --file-path '/var/lib/postgresql/14/main/log/postgresql*.log' --prefix pid=%p,user=%u,db=%d,app=%a,client=%h

You can also give a specific timerange - Example below

ciscollector --logparser inactive_users --file-path /location/to/log/*.log --begin-time "2021-01-01 00:00:00" --end-time "2021-01-01 23:59:59" --prefix <logline prefix>

Last updated