Splunk Search

Take the first value of each multivalue field

sbsbb
Builder

I have a big xml I wan't to make flat :

element1
...
subelement1
 subelement1.1
 subelement1.2
subelement2
 subelement2.1
 subelement2.2

If I make an spath, let say at subelement, I have all the subelements as multivalue.
With nomv, I'm able to convert mvfields into singlevalue, but the content contains all the values...
What I want, is having only the first value from the mvfields...

I have lot of them, so I don't wan't to make an spath, with a path for each...

Tags (4)
1 Solution

kristian_kolb
Ultra Champion
... | eval my_number_1 = mvindex(my_multivalue_field, 0)

See more about the mv*() functions here;

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions

/K

View solution in original post

kristian_kolb
Ultra Champion
... | eval my_number_1 = mvindex(my_multivalue_field, 0)

See more about the mv*() functions here;

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions

/K

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 ...