> 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-key-vault-logs.md).

# Collect Azure Key Vault logs

## Overview

Onum supports ingesting [**Azure Key Vault**](https://azure.microsoft.com/en-gb/products/key-vault) **audit** **logs** and **metrics** using the **Azure Event Hubs** Listener.

## Prerequisites

{% hint style="warning" %}
In order to use this Listener, you must activate the Environment Variable in your distributor using docker compose (`AZURE_EVENTHUB_LISTENER_EXECUTION_ENABLED`)&#x20;
{% endhint %}

## 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.

## Azure Key Vault Diagnostic Settings

{% stepper %}
{% step %}

### **Access the Diagnostic settings of your Azure Key Vault**

Navigate to your **Key Vault** in the Azure Portal and select **Diagnostic settings** under **Monitoring**.
{% endstep %}

{% step %}

### **Create a new diagnostic setting**

* Click **Add diagnostic setting**
* Enter a name (e.g., "KeyVaultToEventHub")
  {% endstep %}

{% step %}

### **Select log categories**

Enable **AuditEvent** logs (captures all key, secret, and certificate operations)

Optionally, enable **AllMetrics** for performance monitoring.
{% endstep %}

{% step %}

### Stream to an event hub

* Check **Stream to an event hub**
* Select your subscription.
* Choose existing Event Hubs namespace or create a new one
* Specify an Event Hub name (create a new one or use existing)
* Optionally provide a policy name
  {% endstep %}

{% step %}

### **Save the diagnostic setting**

Your event hub will now stream Azure Event Key Vault audit logs and metrics.
{% endstep %}
{% endstepper %}

See the [docs on Key Vault ](https://azure.microsoft.com/en-gb/products/key-vault)for more information.

## 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).
