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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...