> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/listeners/listener-integrations/collect-data-from-azure-event-hubs/collect-azure-activity-logs.md).

# Collect Azure Activity logs

## Overview

You can use the **Azure Event Hubs** Listener to collect Azure Activity Logs.

## Prerequisites

{% hint style="warning" %}
In order to use the **Azure Event Hubs** Listener, you must activate the environment variable in your distributor using docker compose (`AZURE_EVENTHUB_LISTENER_EXECUTION_ENABLED`)&#x20;
{% endhint %}

## Azure Activity Logs Setup

In order to ingest activity logs and not hub events, we need to stream the logs to an event hub and configure diagnostic settings for Activity Logs.

{% stepper %}
{% step %}
Go to **Azure Portal > Monitor > Activity Log**.
{% endstep %}

{% step %}
Click **Diagnostic Settings > Add diagnostic setting.** Give the setting a name.
{% endstep %}

{% step %}
Select **Stream to an event hub**.
{% endstep %}

{% step %}
Choose your **Event Hubs namespace** and **Event Hub**.
{% endstep %}

{% step %}
Select **All Metrics** and the relevant log categories.
{% endstep %}

{% step %}
Save the settings and your Event Hub can now be used in the Listener.
{% endstep %}
{% endstepper %}

For more information, see the [Activity Logs documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log?tabs=event-hub).

## Azure Event Hubs Setup

There are various management credentials that Onum needs to communicate with the event hub:&#x20;

* **Event Hubs namespace**
* **Event hub**&#x20;

See [the Azure Event Hubs documentation ](https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-create)for how to create these.

## Onum Setup

Log in to your Onum tenant and click **Listeners > New listener**. Double-click the **Azure Event Hubs** Listener. See the configuration steps in [this article](/listeners/listener-integrations/collect-data-from-azure-event-hubs.md).
