Search code examples
azureazure-application-insightsevent-logazure-log-analyticsazure-monitoring

Is it possible to get windows event logs into application insights?


We have application insights running in our application (on premise and hosted in azure) and we are sending telemetry without issues, different resources, regular data, pageViews, exceptions, traces etc, recently I was asked to increase the telemetry data by adding Windows Event logs (from event viewer), but, to be honest, I am quite new with azure or application insights and all the documentation I find it a bit confusing, since all I find talks about azure monitor, log analytics workspaces configuration, but nothing clear enough (at least to me) that points me to get this data logged into application insights resources specifically. Is this possible to achieve? Something like adding a nuget package and configure applicationInsights.config?

Update... I've followed your suggestions, and added the nuget package for EtwCollectorTelemetryModule, and modified the applicationInsights.config file.

This is how it looks now:
<Add Type="Microsoft.ApplicationInsights.EtwCollector.EtwCollectorTelemetryModule, Microsoft.ApplicationInsights.EtwCollector"> <Sources <Add ProviderName="Microsoft-Windows-Eventlog" Level="Warning" /> </Sources>

But, I'm still not able to see any kind of logs in the traces table (if i understand correctly, logs will be sent to that table.) Do I need to initialize this module in order to start tracing these logs? Or am I doing something wrong?


Solution

  • I agree with @Peter Bons here. When you need to add Windows Event logs to azure application insights, you need to add ETW module in the config file.

    And pls note here, the EtwCollectorTelemetryModule is an asp.net module so that it suitable for asp.net application.

    You can refer to this tutorial to modify the configuration if your program written in asp.net. Pls note, Add Application Insights Telemetry mentioned in the doc is the operation 'right click the project and click Configure Application Insights'

    enter image description here