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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...