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!

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