Dashboards & Visualizations

Count number of occurrences inside an event

msarro
Builder

Hi everyone. I am working to analyze an XML output file from a vendor application we use. Inside, there is an element called <row>, and within that there can be 3 child leaves. A single output file can include several thousand of these <row> elements. How can I count the number of times <row> appears in a single event?

Tags (1)
1 Solution

cramasta
Builder

You can use rex to extract the values of each row element. You also need to use the rex setting max_match=0 (This will extract multiple values with in a single event that match the regex). You can than use the eval mvcount function to count the number of values in that extracted field.

View solution in original post

cramasta
Builder

You can use rex to extract the values of each row element. You also need to use the rex setting max_match=0 (This will extract multiple values with in a single event that match the regex). You can than use the eval mvcount function to count the number of values in that extracted field.

Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...