Splunk Search

eval condition help on manipulating a field which has multiple field values?

pavanae
Builder

I have an eval condition in my query as follows

My_query | eval object=host." (".id.")"  | table host object

which gives me the null values on the object field as follows

host    object
abc

And reason for empty values in object field is that the id field has more than one value.

Now, how can display the object field values in case of multiple values for id field?

0 Karma
1 Solution

solarboyz1
Builder

You could try the following:

Your_Query 
| mvexpand id
| eval object=host." (".id.")"  
| table host object

mvexpand expands the values of a multivalue field into separate events, one event for each value in the multivalue field.

View solution in original post

solarboyz1
Builder

You could try the following:

Your_Query 
| mvexpand id
| eval object=host." (".id.")"  
| table host object

mvexpand expands the values of a multivalue field into separate events, one event for each value in the multivalue field.

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...