# 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="/files/9E3ZgX9xtFSMHRuejC34" 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>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://klouddb.gitbook.io/klouddb_shield/inactive-users-postgres.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
