Splunk Search

How to extract data from XML tags

mhirt34
Observer

Looking for help extracting Info between XML tags. This is generated from windows Print server event logs. the raw data looks like this:

 

<Event xmlns='http://schemas.microsoft.com/win/2004/08/events/event'><System><Provider Name='Microsoft-Windows-PrintService' Guid='{747EF6FD-E535-4D16-B510-42C90F6873A1}'/><EventID>307</EventID><Version>0</Version><Level>4</Level><Task>26</Task><Opcode>11</Opcode><Keywords>0x4000000000000840</Keywords><TimeCreated SystemTime='2022-12-19T20:07:42.882389000Z'/><EventRecordID>Record_ID</EventRecordID><Correlation/><Execution ProcessID='procID' ThreadID='threadID'/><Channel>Microsoft-Windows-PrintService/Operational</Channel><Computer>User's computer</Computer><Security UserID='SID'/></System><UserData><DocumentPrinted xmlns='http://manifests.microsoft.com/win/2005/08/windows/printing/spooler/core/events'><Param1>216</Param1><Param2>Print Document</Param2><Param3>Username</Param3><Param4>Users_computer</Param4><Param5>Print Share Name</Param5><Param6>printer_name</Param6><Param7>1406204</Param7><Param8>1</Param8></DocumentPrinted></UserData></Event>

 


How do extract Peram3 and Peram5? 
I have attempted using this regular expression, but it fails to find it

 

 | regex _raw ="<Param3>.*?<\/Param3>"

 

Labels (4)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

You can try:

  • spath
  • xpath
  • xmlkv
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...