> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.12/configure-cortex-xsoar/customize-and-configure-cortex-xsoar/manage-data/reindex-the-audit-log.md).

# Reindex the Audit Log

When you reindex the Cortex XSOAR database, the audit trail is not reindexed by default and is deleted. You can reindex the audit trail, and it will recover all of the audit trail historical data.

{% hint style="info" %}

### Note

Recovering the historical data may take some time to complete, depending on the data. Your server will not be available during the reindexing process.

(Multi-tenant) - To reindex the audit log for a tenant, follow these instructions with the multi-tenant paths provided below. To reindex the audit logs for multiple tenants, perform these steps for each tenant separately.
{% endhint %}

1. Stop the Cortex XSOAR service.

   **`sudo service demisto stop`**
2. Back up the index directory **`/var/lib/demisto/data/demistoidx`**.

   The backup of the index directory should not be stored under **`/var/lib/demisto`**.

   (Multi-tenant) - For mult-tenant deployments, back up **`/var/lib/demisto/tenants/acc_`*****`TENANT_NAME`*****`/data/demistoidx`**. The backup of the index directory should not be stored under **` /var/lib/demisto/tenants/acc_`` `` `*****`TENANT_NAME`***.
3. Delete the index folder.

   **`sudo rm -rf /var/lib/demisto/data/demistoidx`**

   (Multi-tenant) For multi-tenant deployments, delete the folder **`/var/lib/demisto/tenants/acc_`*****`TENANT_NAME`*****`/data/demistoidx`**.
4. Include historical data in the reindex by editing the **`/etc/demisto.conf`** file to add **`server.audits.restore: true`**
5. Start the Cortex XSOAR service.

   **`sudo service demisto start`**
6. After the server has been restarted and you can view your audit logs, edit the **`/etc/demisto.conf`** file to delete **`server.audits.restore: true`**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.12/configure-cortex-xsoar/customize-and-configure-cortex-xsoar/manage-data/reindex-the-audit-log.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
