> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit Logs (Preview)

Audit logs are created in m3ter whenever an entity in your Organization is created, updated, or deleted. The new Audit logs service makes available a full historical audit trail for entities in your Organization.

On the *Audit logs* page in the m3ter Console you can quickly set up and perform queries and retrieve logs:

* **Time Period**:
  * Select from predefined time period options or specify a custom time period.
  * The maximum time period for a query is 31 days.
  * The query returns audit logs for the selected period.
  * The default time period when the Audit logs page opens is the current month.
* **Query Filters**:
  * **Entity type**. The type of entity you want to return audit logs for.
  * **Entity ID**. The specific entity you want to return audit logs for.
  * **Modified by**. Who or what you want to return audit logs for: **User**, **Service User**, or **System**.
  * **Event type**. The type of audit event you want to return audit logs for: created, updated, or deleted. If left blank, logs for all audit event types are returned.

When you perform a query, any logs satisfying the query are loaded into the Audit logs page and you can:

* Expand logs and review their details.
* View the entity JSON for logs and compare the current with the previous version.

You can also access audit logs for specific entities using a text link provided on Console entity details pages This opens the Audit logs page directly and automatically performs a query to return the entity's most recent audit logs.

This topic explains how to work with the Audit logs feature to configure and perform queries and review details of logs returned:

* [Building and Performing Audit Logs Queries](#building-and-performing-audit-logs-queries)
* [Reviewing Audit Logs Details](#reviewing-audit-logs-details)
* [Viewing Audit Logs JSON](#viewing-audit-logs-json)
* [Opening Audit Logs from Entity Details](#opening-audit-logs-from-entity-details)

> [!WARNING]
>
> **Notes and warnings:**
>
> * **Audit Logs Processing Delay!** The Audit logs loading process takes approximately 5 minutes before logs becomes available for querying.
> * **Audit Logs in Preview Release.** Please note that the Audit logs feature is currently a Preview feature. See [Feature Release Stages](https://docs.m3ter.com/guides/getting-started/feature-release-stages.md) for Preview feature guidance.

## Building and Performing Audit Logs Queries

You can quickly set up and perform queries to return audit logs for your Organization's entities.

**To build and perform an audit logs query:**

1. In the Console main top navigation bar, select **Audit logs**:

![Audit Logs1b](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs1B.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=fb8454b8d4518ba62cd2dbd144747d40)

The **Audit logs** page opens.

2. Select the calendar icon for **Modified at (inclusive)**:

![Audit Logs2b](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs2B.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=d3deb48624b4dad8bd34c4e97d59e804)

3. Define the time period for your query:

* Six pre-defined time period options are available and the default period is **This month**.
* If you want to use a custom period, use the calendars to select inclusive start and end dates.

> [!WARNING]
>
> **Maximum Time Period!** The maximum time period you can use for querying audit logs is 31 days.

4. Use the query filters to return the audit logs you want to review and then select **Perform query**:

* For example, you can return all logs for a specific **Entity type**:

![Audit Logs3b](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs3B.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=c0935f9dffbc49beb3f4a39ab6cdfd04)

In this example, logs for every **Account** and all audit **Event types** are returned.

> [!NOTE]
>
> Note that text hotlinks are provided for each audit log under **Entity ID** and **Modified by**, which allow you to open either the **Entity details** or **User details** page directly.

* Alternatively, you can use the **Modified by** to return logs for all audit **Event types** linked to a specific Organization user:

![Audit Logs4a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs4A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=810c517e4378448c76628b641935aae0)

> [!WARNING]
>
> **Important!** In addition to a time period, your must select either an **Entity type** or **Modified by** filter. If you try to perform a query with only a time period selected, you'll receive an error.

* You can use the **Event type** filter to show only logs of a specific type:

![Audit Logs5a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs5A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=79072165eae9ca962cadc6f3b68f29a9)

In this example, only the logs for the **CREATED** **Event type** linked to the selected user are returned.

* If you want to filter your query by **Entity ID**, you must also select the relevant **Entity type**:

![Audit Logs6a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs6A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=624314353225a60f2aad20942f991f6c)

In this example, a single audit log is returned for a specific Account.

> [!WARNING]
>
> **Caution!** If you enter mismatched **Entity ID** and **Entity type** - for example a **Meter** ID but select **Account** for type - then this mismatch will not be caught and no error will show.

## Reviewing Audit Logs Details

When you have built and performed a query that returns the audit logs, you can expand logs to review details.

**To review audit logs details:**

1. In the Console main top navigation bar, select **Audit logs**. The **Audit logs** page opens.
2. Build and perform a query that returns the audit logs you want to review.
3. Use the arrow on the left side of an audit log record to expand it:

![Audit Logs8a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs8A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=b939eebc6214f7a359cdf61d0f44f1f0)

In this example, a **CREATED** audit log is expanded:

* The entity type is shown together with **Total fields** created on the entity.
* You can then expand individual fields to reveal their values.

The details given depend on the audit log type.

4. If you expand an **UPDATED** audit log, a breakdown of the updates is given:

* **Total changes**
* **Fields created**
* **Fields updated**
* **Fields deleted**

You can then expand an individual change to reveal details:

![Audit Logs9a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs9A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=ea73d4732f9c0c04b5b6229713ea5e0c)

5. If you expand a **DELETED** audit log, you can use a **view JSON** link to show the last version of the entity prior to its deletion:

![Audit Logs10b](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs10B.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=28c72377b4127cb3af2657a82911227d)

## Viewing Audit Logs JSON

In addition to reviewing log details in the Audit logs page, you can also quickly open a modal screen to view a log's JSON.

**To view audit logs JSON:**

1. In the Console main top navigation bar, select **Audit logs**. The **Audit logs** page opens.
2. Build and perform a query that returns the audit logs whose JSON you want to view.
3. Select the view JSON icon at the right side of an audit log:

![Audit Logs11](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs11.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=c27363e2f7d475a5cc5ddb9c6f96f902)

Alternatively, if you've expanded an audit log to review its details, select **View JSON**:

![Audit Logs14](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs14.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=9543f6d63c74c5c463695fa720c658ce)

A modal opens:

![Audit Logs12](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs12.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=efce901ac7196bba05489c5a5d4e4457)

In this example, the JSON for a **CREATED** audit log shows the **Current version** of the entity.

4. If you view JSON for an **UPDATED** audit log, the **Current version** and **Previous version** are shown for comparison and changes highlighted:

![Audit Logs16](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs16.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=0851dc4bf0961ba45a9b8233ee97dc3d)

In this example, a **Meter** was updated to add a new Data Field and this change is highlighted in green. Any fields changed for the update are identified and highlighted in blue.

5. If you view JSON for a **DELETED** audit log, the **Previous version** of the entity is shown:

![Audit Logs17](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs17.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=28ae094a7ae2112132259720f6dc2dff)

## Opening Audit Logs from Entity Details

You can access audit logs for specific entities using a text link provided on entity details pages. This opens the Audit logs page directly and automatically performs a query to return the entity's most recent audit log.

**To open audit logs from entity details pages:**

1. In the Console, open the details page of the entity you want to open audit logs for.
2. Select **View audit logs**:

![Audit Logs18a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs18A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=6b4f233fc761489345efdf9210cfe530)

The **Audit logs** page opens:

![Audit Logs20a](https://mintcdn.com/m3ter/jRzYtxDteE7QzRRU/images/AuditLogs20A.png?fit=max\&auto=format\&n=jRzYtxDteE7QzRRU\&q=85\&s=2c456fb3b1d4716afde2d5d7e531139f)

In this example, the **Audit logs** page for a **Meter** was opened from its details page. Note that when the **Audit logs** page opens for an entity, a query is performed automatically to return the most recent audit log together with any other logs falling in the 30 day period prior to the date of the most recent log.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.