# Audit Logs

**Audit log** in BotDistrikt records or logs all the interactions and activities that occur within the chatbot system. It serves as a chronological history of events, actions, and data related to your chatbots’ operations.&#x20;

Audit logs are essential for monitoring system usage, debugging issues, ensuring security compliance, and tracking changes made to chatbot configurations.

### Key Information Captured

Each audit log entry contains the following fields:

* **ID**: Unique identifier for each log entry
* **User**: The user or system that performed the action
* **Action**: The type of action performed (e.g. LOGIN, CREATED, UPDATED, DELETED)
* **Entity Name**: The type of object affected (e.g. card, access, tag, text\_prompt)
* **Entity ID**: Unique identifier of the affected entity
* **Timestamp**: Date and time when the action occurred

### Types of Activities Logged

The audit log captures a wide range of events, including:

* **User interactions** (e.g. logins, access events)
* **System events** (e.g. automated processes)
* **Configuration changes** (e.g. updates to chatbot content or settings)
* **Security-related actions** (e.g. access control changes)
* **CRUD operations**:
  * **CREATED**
  * **UPDATED**
  * **DELETED**

### Entity Names

The queryable entity names in the platform are tabulated below

<table><thead><tr><th width="185.6484375">Entity Name</th><th>Description</th></tr></thead><tbody><tr><td>access</td><td>Team member user access record</td></tr><tr><td>action_prompt</td><td>LLM Agent that outputs a value or JSON schema into a user attribute </td></tr><tr><td>action</td><td>Context change response modifying memory and variables</td></tr><tr><td>alibaba_cloud_app</td><td>Alibaba Cloud integration settings</td></tr><tr><td>assistant_app</td><td>Google Assistant integration settings</td></tr><tr><td>audio</td><td>Audio response from chatbot</td></tr><tr><td>azure_openai_app</td><td>Microsoft Azure OpenAI integration settings</td></tr><tr><td>broadcast</td><td>Bulk notification to multiple users</td></tr><tr><td>button</td><td>Clickable button attached to responses</td></tr><tr><td>card</td><td>Rich element with image, title, subtitle, buttons</td></tr><tr><td>chatbase_app</td><td>Chatbase integration settings</td></tr><tr><td>condition</td><td>Evaluates incoming message against context property and value</td></tr><tr><td>csv_export</td><td>CSV Export record</td></tr><tr><td>deepseek_app</td><td>DeepSeek integration settings</td></tr><tr><td>dialogflow_app</td><td>Dialogflow integration settings</td></tr><tr><td>docs_app</td><td>Google Docs integration settings</td></tr><tr><td>document</td><td>Document response from chatbot</td></tr><tr><td>facebook_app</td><td>Facebook App integration settings</td></tr><tr><td>facebook_page</td><td>Facebook Page integration settings</td></tr><tr><td>form_question</td><td>Form question inside a form</td></tr><tr><td>form</td><td>Fillable form in a linear flow</td></tr><tr><td>function</td><td>JavaScript function to modify or evaluate message context</td></tr><tr><td>group</td><td>Set of rules organizing bot topics and functionalities</td></tr><tr><td>image</td><td>Image response from chatbot</td></tr><tr><td>instagram_page</td><td>Instagram Page integration settings</td></tr><tr><td>integration_step</td><td>Integration step response</td></tr><tr><td>langfuse_app</td><td>Langfuse integration settings</td></tr><tr><td>llm_source</td><td>Source for LLM chunks, in the form of Website, Document, Google Docs or Google Sheets</td></tr><tr><td>openai_app</td><td>OpenAI integration settings</td></tr><tr><td>persisted_menu</td><td>Always-on clickable buttons at chat screen bottom</td></tr><tr><td>quick_reply</td><td>Transient button for user to respond to story</td></tr><tr><td>response_group</td><td>Text response from chatbot with random variant selection</td></tr><tr><td>response</td><td>Text response variant for random selection</td></tr><tr><td>rule</td><td>Conditions to evaluate message and select story response</td></tr><tr><td>salesforce_app</td><td>Salesforce integration settings</td></tr><tr><td>sheets_app</td><td>Google Sheets integration settings</td></tr><tr><td>skype_app</td><td>Skype integration settings</td></tr><tr><td>sms_app</td><td>SMS integration settings</td></tr><tr><td>step</td><td>One response in a story with position order</td></tr><tr><td>sticker</td><td>Sticker response from chatbot with emoji or set</td></tr><tr><td>story</td><td>Bot response with multiple response types and steps</td></tr><tr><td>tag</td><td>Label applied to users and models for filtering</td></tr><tr><td>teams_app</td><td>Microsoft Teams integration settings</td></tr><tr><td>telegram_app</td><td>Telegram integration settings</td></tr><tr><td>template</td><td>Bot Template to create a new bot from</td></tr><tr><td>text_prompt</td><td>LLM Agent that performs RAG and outputs a response</td></tr><tr><td>thread_comment</td><td>Comments in threads</td></tr><tr><td>thread</td><td>A group of comments for an entity</td></tr><tr><td>twitter_app</td><td>Twitter integration settings</td></tr><tr><td>vertexai_app</td><td>Google Vertex AI integration settings</td></tr><tr><td>video</td><td>Video response from chatbot</td></tr><tr><td>webchat_app_placement</td><td>Website Chat Widget variant settings</td></tr><tr><td>webchat_app</td><td>Website Chat Widget settings</td></tr><tr><td>webhook_app</td><td>Webhook to notify other applications on user message</td></tr><tr><td>webhook</td><td>API call response from chatbot to external systems</td></tr><tr><td>wechat_app</td><td>WeChat integration settings</td></tr><tr><td>whatsapp_app</td><td>WhatsApp integration settings</td></tr><tr><td>wit_app</td><td>Wit.ai integration settings</td></tr><tr><td>wrong_response</td><td>Tracked issue based on a message-response pair</td></tr><tr><td>zendesk_app</td><td>Zendesk integration settings</td></tr></tbody></table>

### How to Access Audit Logs

To access the audit log, navigate to the side panel **Settings → Audit Log**

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FfErHCrdQPYQ8epBcCCYN%2FScreenshot%202024-07-08%20at%202.09.24%E2%80%AFPM.png?alt=media&#x26;token=d78ef3b6-62d0-4f6c-be58-4c62482eb8f4" alt=""><figcaption><p>Audit Log Dashboard</p></figcaption></figure>

### Viewing Changes

* Hover over **Entity Name** to view the code block of changes made.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FbUeSt1021H9h1zleqtzr%2FScreenshot%202024-07-08%20at%202.12.44%E2%80%AFPM.png?alt=media&#x26;token=ef9f534c-c392-4aae-ad1b-ec63ccce919b" alt=""><figcaption></figcaption></figure>

* This allows you to inspect exactly what was modified during an update.

#### Action Types and JSON Data Deltas

#### 1. Action: CREATED

The **CREATED** action indicates that a new record has been added to the database.

* **Visual Cue:** Fields are highlighted in **Green**.&#x20;
* **Behavior:** Because there is no "previous state" for a new entity, the system displays the entire initial data set as an addition.
* **Example:** When a user creates a new `Text` responses under "Responses", all defined attributes like `name` and `is_active` will appear in green to show they are now part of the system.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FssPoOJj1WVquCi2V7jv8%2FCreated.jpg?alt=media&#x26;token=608097e9-a9bc-4ad8-a468-b176fbfd4094" alt=""><figcaption></figcaption></figure>

#### 2. Action: UPDATED

The **UPDATED** action records modifications made to an existing record.

* **Visual Cue:** **Red Strikethrough** (Old) and **Green Highlight** (New).
* **Behavior:** The system performs a "delta" comparison. It shows you exactly what the value was before the change and what it became after the save.
* **Example:** If a `name` is changed from `"Hello World!"` to `"Good Morning 🌞"`, the log will display:&#x20;

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FmPE8YCwmrAqrkxliXLMW%2FUPDATED.jpg?alt=media&#x26;token=0a52b1a3-1af7-4467-bd72-df1471145896" alt=""><figcaption></figcaption></figure>

#### 3. Action: DELETED

The **DELETED** action tracks the removal of a record from the system.

* **Visual Cue:** All fields are highlighted in **Red with a Strikethrough**.&#x20;
* **Behavior:** The JSON snapshot represents the "final state" of the data immediately before it was removed. The red formatting indicates that this specific data set is no longer active or reachable.
* **Example:** Deleting a `Text` will show the entire object struck through in red, serving as a historical record of what was removed.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2F7nWF5eBXqVIIjDGADwdy%2FDELETED.jpg?alt=media&#x26;token=3a5a33e8-ac9e-4917-9fd2-feb5dc46e5f3" alt=""><figcaption></figcaption></figure>

### Filtering Logs

You can use the **filter function** to refine and search for specific logs based on:

* User
* Action type
* Entity
* Date/time range

This helps quickly locate relevant events for troubleshooting or audits.

**Add filter(s)** to search through specific logs.

### Example

An example log entry may show:

* A user login event
* A deleted card entity
* The exact timestamp of when the action occurred

### How to Apply Filters

1. Click the **+ add filter** button.

<div align="left"><figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FwSCiGbJGCJitbd8iRbXE%2Fadd%20filter.jpg?alt=media&#x26;token=d7c1dc13-21dc-47cd-a600-36aeef37b6d9" alt=""><figcaption></figcaption></figure></div>

2. Select category from the first dropdown.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FzNQg4NPkvNb8ZwxexCGI%2FSelect%20Column.jpg?alt=media&#x26;token=fbe500a0-d6f5-4245-b737-6eecbe288594" alt=""><figcaption></figcaption></figure>

3. Choose your **Operator** (e.g., `contains`, `equals`).
4. Input the **Value** or select it from the provided list/calendar.
5. To remove a filter, click the **trash icon** 🗑️ next to the filter row.

#### 1. Filter by ID

Filter records based on their unique identifier.

* **Operators:** `equals`, `not equals`, `greater than`, `less than`.
* **Use Case:** Best for locating a specific log entry if you have the direct ID number.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FYRMYQj2GkGyFZjoPVX9I%2FFilter%20by%20ID.jpg?alt=media&#x26;token=ec56cee7-5b53-43f8-9899-72091514b55f" alt=""><figcaption></figcaption></figure>

#### 2. Filter by User

Filter logs based on the person who performed the action.

* **Operators:** `equals`, `not equals`.
* **Use Case:** Auditing the activity of a specific team member or administrator.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FSNx86KKUfDRpPNYiM7rG%2FFilter%20by%20User.jpg?alt=media&#x26;token=694f5f87-dd46-423c-a2d2-68102dfac456" alt=""><figcaption></figcaption></figure>

#### 3. Filter by Action

Filter by the type of action that occurred.

* **Available Values:** `CREATED`, `UPDATED`, `DELETED`, `INVITED`, `ACCEPTED`, `LOGIN`, `LOGOUT`.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2Fs8WbnsQ35pMgYCT8letm%2FFilter%20by%20Action.jpg?alt=media&#x26;token=3f818a41-74cd-4770-833d-8bd46f00ede8" alt=""><figcaption></figcaption></figure>

#### Actions on Entities / Objects

Track changes to specific objects within the platform (such as story changes or user access activities).

**Use Case:** Finding all instances of a specific behavior, such as seeing who has logged in recently or identifying all deleted entities.

* **CREATED**: Logged when a new entity is initially added to the system. The associated JSON will show all initial values in green.
* **UPDATED**: Logged whenever an existing entity is modified. The JSON delta will highlight exactly which values were changed.
* **DELETED**: Logged when an entity is removed. This provides a final snapshot of the data before deletion.

#### 4. Filter by Entity Name

Filter based on the name of the object being modified (e.g., a specific response group name).

* **Operators:** `equals`, `not equals`, `contains`, `not contains`.
* **Use Case:** Searching for all changes related to access management, or if want to search actions done to a specific story (even if you only remember a part of the story name, use "contains").

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FWO0SnY0tATxF6Lps98hx%2FFilter%20by%20Entity%20Name.jpg?alt=media&#x26;token=b40ca36b-149a-4a09-a858-d76da898a805" alt=""><figcaption></figcaption></figure>

#### 5. Filter by Entity ID

Filter based on the unique ID of the entity itself.

* **Operators:** `equals`, `not equals`, `greater than`, `less than`.
* **Use Case:** Tracking the entire lifecycle (creation, updates, deletion) of one specific entity e.g. tag, card, story across different points in time.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FHjkACz3mNZOtWSZUiyZk%2FFilter%20by%20Entity%20ID.jpg?alt=media&#x26;token=5384b5af-d487-4cf7-80b7-31ce5f078afd" alt=""><figcaption></figcaption></figure>

#### 6. Filter by Timestamp

Narrow down logs by a specific date and time.

* **Modes:**
  * **Normal:** Select a specific date from the calendar and a specific time.
  * **Relative:** (e.g., "Last 1 hour", "Last 7 days").
* **Operators:** `greater than` (after), `less than` (before).
* **Use Case:** Investigating incidents that occurred within a specific timeframe.

<figure><img src="https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LirAdLo22OkAW9w3tvY%2Fuploads%2FsNZ8UPDMl0KhdRjTWF39%2FFilter%20by%20Timestamp.jpg?alt=media&#x26;token=0901ef21-394b-41c7-90c5-2e68442bc5c7" alt=""><figcaption></figcaption></figure>

#### Notes

* Logs are displayed in descending chronological order (most recent first).
* All actions are recorded automatically and cannot be modified.
