# Audit

You can thus know the Datasentinel modules as well as the selected instances with their date of use.

Convenient if you want to delete inactive accounts for example

## Configure

{% hint style="info" %}
On a new installation, the audit is **enabled** with a retention of **60** days.
{% endhint %}

{% stepper %}
{% step %}

### Open tools menu

> <img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FzWTph4wfhIrk7UQIVbl6%2Ftools_icon1.png?alt=media&#x26;token=ac39e6ab-8765-4938-8458-60065f675c19" alt="" data-size="original">

{% endstep %}

{% step %}

### Global settings

> <img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FzePbi66m7shUU5qZwY2x%2Ftools_menu1.png?alt=media&#x26;token=5b8c7ea7-beb2-4e3b-9339-299c83810fdf" alt="" data-size="original">

{% endstep %}

{% step %}

### Audit settings

<figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2F20OUEYDlSPNcrMIC9WE6%2Faudit_settings.png?alt=media&#x26;token=7858f52d-f6eb-4f07-976b-0fecee7e6078" alt=""><figcaption><p>Audit settings</p></figcaption></figure>

Enable or disable audit logging and configure the retention period (in days) for audit records.

When audit logging is enabled, Datasentinel records all user actions, including the module used and the selected PostgreSQL instance.
{% endstep %}
{% endstepper %}

## View

From the **Tools** menu, click **Users**.

The **Last Use** field shows the date of the most recent action performed by each user.

<figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FFqnGdZemRlruSjl6orNQ%2Faudit_last_use.png?alt=media&#x26;token=ff809d62-29f5-4b72-99cb-0f7e023e4f7b" alt=""><figcaption><p>Audit last use</p></figcaption></figure>

All user actions can be viewed in the **Usage** tab.

<div data-with-frame="true"><figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2F1gR3rEJxiZs11LQVQy5I%2Faudit_usage.png?alt=media&#x26;token=c861a93a-2bca-4073-accb-47bb4e39ccd0" alt=""><figcaption><p>Usage</p></figcaption></figure></div>

Actions are grouped by user and PostgreSQL instance. For more detailed analysis, results can also be grouped by day and/or module.

The **Number of Uses** column shows how many times each action was performed.

{% hint style="info" %}
Actions can also be viewed at the individual user level.
{% endhint %}

<div data-with-frame="true"><figure><img src="https://1072624949-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlcWi6G1jtNuyGT9C0pkc%2Fuploads%2FfV4qzJ0AHRb8mmVrPhDV%2Faudit_user_usage.png?alt=media&#x26;token=67de2599-33f5-4ab9-89a8-071b01e19e7f" alt=""><figcaption><p>User audit actions</p></figcaption></figure></div>
