# Inactive Users(Postgres)

Please watch video [youtube.com/watch?v=BXx1vCRmRlQ](https://www.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&#x20;

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)

<figure><img src="https://3013412235-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj94nGPKUS9dlzKveRYHc%2Fuploads%2F4cjm6wwLKetVzrGD43nU%2Fimage.png?alt=media&#x26;token=91205822-627b-4eff-9548-d310e37a2b73" alt=""><figcaption></figcaption></figure>

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&#x20;

```
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>
```
