Getting Azure VM event logs into Eventhubs - azure

We are currently investigating methods in getting our Security log data out of our Azure VM's and into our SIEM for analysis.
Currently I have been able to get the logs from the VM to log analytics work-space but I'm no sure how to get them from the log analytics workspace to the eventhub to then pull down the events.
Has anyone faced a similar challenge before / how did you overcome this challenge?
I'm currently pull the data into a Log analytics workspace

Welcome to Stackoverflow!
Azure diagnostic logs can be streamed in near real time to any application using the built-in “Export to Event Hubs” option in the Portal, or by enabling the Event Hub Authorization Rule ID in a diagnostic setting via the Azure PowerShell Cmdlets or Azure CLI.
What you can do with diagnostics logs and Event Hubs:
Here are just a few ways you might use the streaming capability for Diagnostic Logs:
Stream logs to 3rd party logging and telemetry systems – You can stream all of your diagnostic logs to a single event hub to pipe log data to a third-party SIEM or log analytics tool.
View service health by streaming “hot path” data to Power BI – Using Event Hubs, Stream Analytics, and Power BI, you can easily transform your diagnostics data in to near real-time insights on your Azure services.
Build a custom telemetry and logging platform – If you already have a custom-built telemetry platform or are just thinking about building one, the highly scalable publish-subscribe nature of Event Hubs allows you to flexibly ingest diagnostic logs.
After data is displayed in the event hub, you can access and read the data in two ways:
Configure a supported SIEM tool. To read data from the event hub, most tools require the event hub connection string and certain permissions to your Azure subscription. Third-party tools with Azure Monitor integration included.
For more details, refer "Stream Azure Diagnostic Logs to an event hub" and "How to integrate Azure Monitor with SIEM tools".
Hope this helps.

You can’t pull the VM data from log analytics to an event hub, you can use windows/Linux diagnostic extensions to route data to an event hub.
Stream Azure monitoring data to an event hub for consumption by an external tool

Related

Azure IOT-Edge - Logs to Azure Monitor

Is there a supported/standard way to send container logs (info, errors etc.) to Azure Monitor, as there is for metrics with the Metrics collector module in Azure IoT Edge?
I know about this solution, but is there a supported/standard way to solve this?
https://github.com/veyalla/logspout-loganalytics
/Jonas
There is IoT ELMS, which is mentioned in the docs. It leverages an OpenTelemetry module that uploads logs to Log Analytics. It also describes a second way of doing it, which utilizes a timed Azure Function to send Direct Methods to the device, asking for the logs and then uploading them to Log Analytics.
But the repository you linked is by Venkat Yalla; his team is responsible for the Metrics collector, so I'd say that module is as close to standard as it'll get.

Connect Azure IoTHub to application insights

I am building an application in Azure, and I really like the application Insights "Application Map". I would like to integrate IoTHub to the map, so I can check the entire stack from device to webinterface in one central place.
What I have tried:
I tried creating a diagnostic setting directly in the IoTHub.
For destination I used the same Log Analytics workspace as my application insights is using.
Results:
I can see logs using the "Logs" tab under the IoTHub, but nothing in the application insights.
The actual question:
How do I connect the IoTHub to the application insights? If this is not possible, what do you normally do to check if everything is as it should be inside the IoTHub?
Application Insights is a feature of Azure Monitor that provides extensible application performance management (APM) and monitoring for live web apps.
What metrics do you plan to track through Application Insights?
When you have critical applications and business processes relying on Azure resources, you want to monitor those resources for their availability, performance, and operation. You can use the features of Azure Monitor to analyze, monitor data generated by Azure IoT Hub and setup alerts.
Azure IoT Hub creates monitoring data using Azure Monitor, which is a full stack monitoring service in Azure that provides a complete set of features to monitor your Azure resources in addition to resources in other clouds and on-premises.
Start with the article Monitoring Azure resources with Azure Monitor, which describes the following concepts:
What is Azure Monitor?
Costs associated with monitoring
Monitoring data collected in Azure
Configuring data collection
Standard tools in Azure for analyzing and alerting on monitoring data
Please see Monitoring Azure IoT Hub and Set up and use metrics and logs with an IoT hub for more details.

Azure: Stream custom VM logs to Event Hub

How can this be done? AFAIK you can stream to Event Hub only via "Diagnostic settings" / Diagnostics extension, but custom logs are AFAIK only available for Log Analytics Agent. I am a bit confused by the many Azure VM agents. In AWS I would use the Firehose Agent for streaming custom logs to Kinesis, for instance. Very simple.
You can use Diagnostic Logging to not just forward to Log Analytics but also store to Azure Storage (BLOB) or to Event Hub from Event Hub you can forward to whatever Azure Service which supports this method or from Event Hub to Azure Data Explorer.
ADX is a service specifically made for Logs\Telemetry or other kinds of data.
An example below for Logs to Event Hub:
https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/tutorial-azure-monitor-stream-logs-to-event-hub
How to use Azure Data Explorer to ingest Logs:
https://learn.microsoft.com/en-us/azure/data-explorer/ingest-data-no-code?tabs=diagnostic-metrics

Azure IoT Hub - Where can I see why the hub disconnects the devices?

I'm using an Azure IoT Hub. I'm still in the development phase. It used to work fine, but now the hub is disconnecting the devices almost immedially after they connect. Where can I see some logs or info about why the hub is disconnecting? And if I have to activate some services, which ones?
You may need to turn on diagnostics for IoT Hub for logging the device connection events and errors. Once the logs and alerts are ON for connected devices, you will get alerts, error logs when errors occur. The troubleshooting link to begin with can be https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-troubleshoot-connectivity which captures details about how to enable diagnostics, alerts and other possible troubleshooting methods. This section 'Resolve connectivity errors' has description on how to look for common issues when you receive an alert and this seems to have dependency on Azure monitor logs to be enabled. It also furnishes information in terms of problem resolution guides for the most common errors.
There are couple of services integrated with IoT Hub like Azure Monitor and Azure Resource Health that help to provide you with the data required for keeping your IoT solution running in healthy state. Azure Resource Health helps to monitor whether your IoT hub is up and running. Here is a related link on iot hub health monitor and diagnose problems that can be a additional reference for you.
Azure Monitor stores log data in a Log Analytics workspace, which is an Azure resource and a container where data is collected, aggregated, and serves as an administrative boundary as conveyed in Azure monitor logs. Data in Azure Monitor Logs is retrieved using a log query written with the Kusto query language, which allows you to quickly retrieve, consolidate, and analyze collected data.

Is there a way to stream Azure Information Protection Activity Logs to an Event Hub?

I have configured Azure Information Protection analytics through the Azure portal for my subscription and I am able to see log data under the Activity logs (preview) tab.
I want to forward that log data to a configured Event Hub but I have not found a way to do it. This data appears to be written to a table called InformationProtection_CL. How do I get that query output to stream to an Event Hub? Is what I'm trying to do possible?
You can use the REST API Query - Get to get the log data in the table.
GET https://api.loganalytics.io/v1/workspaces/{workspaceId}/query?query={query}
Then follow this doc to send events to the event hub programmatically, the specific situation and language depend on you.
https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-standard-getstarted-send#send-events

Resources