This guide walks through how to add an Azure Event Hub logging policy to your Cloudmersive Reverse Proxy Server, step by step.
Prerequisites
- A Cloudmersive Reverse Proxy Server deployment with at least one site configured
- An Azure Event Hub namespace and Event Hub already created in the Azure Portal
- A Shared Access Policy with Send permissions configured on the Event Hub or namespace
Step 1 - Navigate to Your Site
- Log in to the Cloudmersive Portal.
- Navigate to your Private Cloud deployment and open the Sites tab.
- Click Manage... next to the site you want to add logging to.
Step 2 - Add the Logging Policy
- On the Manage Site page, scroll down to the Logging Policies section.
- Click the Add Logging Policy button.
- On the Add Logging Policy page, select Azure Event Hub from the Policy dropdown.
- Click Add Policy.
Step 3 - Configure Azure Event Hub Connection
You will be taken to the Edit Logging Policy page. Fill in the Azure Event Hub connection details:
- Namespace URL - The full URL of your Azure Event Hub namespace (e.g.,
https://mynamespace.servicebus.windows.net)
- Event Hub Name - The name of the specific Event Hub to send log events to
- Shared Access Policy Name - The name of the Shared Access Policy that has Send permissions
- Shared Access Key - The key for the Shared Access Policy
You can find these values in the Azure Portal under your Event Hub namespace resource.
Step 4 - Configure the Logging Trigger
Under the Policy Trigger section, select when the logging policy should activate:
- All Traffic - Log every request and response. This is the default.
- Policy Blocked Traffic - Only log requests that were blocked by a security policy.
- Policy Allowed Traffic - Only log requests that were allowed through by security policies.
Step 5 - Select Data to Log
Under the Data to Log section, enable the checkboxes for the data you want included in each log entry:
- Log request URL - Includes the full URL, HTTP method, hostname, port, and User-Agent.
- Log client IP address - Includes the client IP, X-Forwarded-For, and True-Client-IP values.
- Log request header - Includes all request headers as a JSON array.
- Log policy result details - Includes the security policy evaluation outcome.
Regardless of which options you select, every log entry always includes the Node ID, Transaction ID, HTTP response code, content lengths, and response timing metrics.
Step 6 - Save the Policy
Click the Save Policy button to save your configuration. You will be redirected back to the Manage Site page.
Step 7 - Push Configuration
For the new logging policy to take effect on your running reverse proxy server:
- Navigate back to your deployment page.
- Click Push Configuration to apply the updated configuration to your node(s).
Verifying the Integration
Once the configuration has been pushed and traffic begins flowing through the reverse proxy, you can verify that events are arriving in your Event Hub by:
- Opening the Azure Portal and navigating to your Event Hub namespace.
- Selecting the Event Hub you configured.
- Checking the Overview page for incoming message counts on the activity graph.