# Storage Times

The following defaults can be customized via the configuration file, with the following default values set:&#x20;

* Metrics (hosts/endpoints): 14 days&#x20;
* System events (hosts): 3 days&#x20;
* Network anomalies (hosts): 3 days&#x20;
* Audits (pentests): 90 days&#x20;
* Activity log: 6 months&#x20;
* PDFs: 1 year

{% hint style="warning" %}
If you customize a **configuration file** on the application server, you must always run **`setup.sh` afterwards**. Only then will the settings be applied.
{% endhint %}

{% hint style="warning" %}
Be sure to follow the JSON format. In case of problems, use a JSON validator to verify that the entire file is compliant.
{% endhint %}

1. Open the configuration file.

```
sudo nano /opt/enginsight/enterprise/conf/services/config.json
```

2. Add or adjust the values of the following `indexes` parameters to the **existing section** `database`. **The storage time is specified in seconds.** Leave the value of `uriConnectionString` as you find it in your `config.json`.

`database` without defined storage times:

```
"database": {
    "uriConnectionString": "%%MONGODB_URI%%"
  },
```

The extended section then looks like this:

```
 "database": {
    "uriConnectionString": "%%MONGODB_URI%%",
    "indexes": {
      "siemIncidents": {
        "ttl": 7776000
      },
      "siemExports": {
        "ttl": 2592000
      },
      "shieldLogs": {
        "ttl": 2592000
      },
      "hostFimLogs": {
        "ttl": 86400
      },
      "pentestAudits": {
        "ttl": 7776000
      },
      "endpointWebsites": {
        "ttl": 1209600
      },
      "hostMetrics": {
        "ttl": 1209600
      },
      "hostEvents": {
        "ttl": 259200
      },
      "hostNetworkAttacks": {
        "ttl": 259200
      },
      "history": {
        "ttl": 15552000
      },
      "reportsPDFs": {
        "ttl": 31536000
      }
      
    }
  },
```

3\. Save the configuration file (Ctrl+o) and confirm the saving process. Close nano (Ctrl+x).

4\. Navigate to /opt/enginsight/enterprise

```
cd /opt/enginsight/enterprise
```

5\. Update your installation for the changes to take effect.

```
sudo ./setup.sh
```

{% hint style="info" %}
TTL (time to life) specifies the duration of data storage in **seconds**. If no values are set, the default values are used.
{% endhint %}

{% hint style="info" %}
The minimum value is set to 259200 seconds (3 days) to prevent accidental deletion of data.
{% endhint %}

{% hint style="info" %}
A day has 86400 seconds.
{% endhint %}


---

# 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://docs.enginsight.com/docs/manual/english/on-premises/configuration/storage-times.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.
