Getting Data In

Extracting wineventlog from Azure EventHub WindowsEventLogsTable

kajmaple
Loves-to-Learn Lots

Hey,

We are currently ingesting wineventlog from some of our Azure VMs via Eventhub. As such, their assigned sourcetype is the eventhub sourcetype, which means they are not subject to the wineventlog field extractions.

These logs do contain a "raw xml" data field, which is like xmlwineventlog, however, using things such as xmlkv, spath or xpath don't work as intended, and require additional work to extract the data correctly. Unfortunately due to this, we are unable to dump this extra SPL into a field extraction or calculated field.

Please find the SPL below:

 

index=azure sourcetype=mscs:azure:eventhub category="WindowsEventLogsTable"
| fields properties.RawXml
| spath input=properties.RawXml 
| eval test=mvzip('Event.EventData.Data{@Name}', 'Event.EventData.Data', "=")
| mvexpand test
| rex field=test max_match=0 "^(?<kv_key>[^=]+)=(?<kv_value>[^=]+)$"
| eval {kv_key}=kv_value

 

 

The end goal with this is to successfully extract the relevant windows event fields so that it can be datamodel mapped. It's not possible to install UFs onto these VMs, so unfortunately not the solution here. We'd ideally also want to avoid using "collect" to duplicate the data to a separate index/sourcetype.

Has anyone else encountered this and managed to come up with a solution? Thanks

Labels (2)
0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...