Splunk Enterprise

help with EVAL command

shreyasamin64
Explorer

| eval new_name=mvindex(split(name, ","),0),         first name 0 and last name 1

split first and last name

why split and 0&1 used in the pipeline

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

split creates a multi-value field, mvindex returns one of the values referenced by the index, 0 in this instance, which is the first value.

View solution in original post

0 Karma

shreyasamin64
Explorer

yes we use "," in some data's 

thank you @ITWhisperer 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

split creates a multi-value field, mvindex returns one of the values referenced by the index, 0 in this instance, which is the first value.

0 Karma

shreyasamin64
Explorer

@ITWhisperer  thank you 👍  

why do we use  ","   

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The use of "," was your suggestion. I assume your data has name comma separated, e.g. "John,Smith". If the name is delimited with a different character, you need to change the split command accordingly.

0 Karma
Get Updates on the Splunk Community!

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!

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

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...