Splunk Search

How do I divide multiple values in a field into new separate fields at search-time?

BrandSentiment
Explorer

I have created a delim operator as follows:

| makemv delim=","  TONE 

which returns the following values in the TONE field:

0.86767895878525
3.25379609544469
2.38611713665944
5.63991323210412
24.7288503253796
0.867678958785249

I would like to to separate each of these values into new fields at the time of search:

Tone
Positive Score
Negative Score
Polarity
Activity Reference Density
Reference Density

Is this possible?

Tags (3)
0 Karma

sundareshr
Legend

Assuming the makemv command is returing data in the right format into a field named tone, to extract each value use the following command

..| eval gkg_Tone1=mvindex(tone, 0) | eval gkg_Pos_Score=mvindex(tone, 1) ad so on for rest of the fields. This assumes the order in which the 6 data point are arranged is always the same.

dart
Splunk Employee
Splunk Employee

The mvindex function will let you select individual elements in a multivalued field : http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Commonevalfunctions

BrandSentiment
Explorer

Thanks Dart,

How do I structure the command:

I want to take each of these values in a field named gkg_TONE (there are always 6 values comma separated):

0, 3.25379609544469, 2.38611713665944, 0, 24.7288503253796, 0.867678958785249

With these values I would like to create these fields:

gkg_TONE1="0"
gkg_Pos_Score="3.25379609544469"
gkg_Neg_Score="2.38611713665944"
gkg_Polarity="0"
gkg_Ativity_Ref="24.7288503253796"
gkg_Ref_Dens="0.867678958785249"

I have tried this:

| eval n=mvindex (gkg_TONE, gkg_TONE1, gkg_Pos_Score, gkg_Neg_Score, gkg_Polarity, gkg_Ativity_Ref, gkg_Ref_Dens)

but get:

"Error in 'eval' command: The arguments to the 'mvindex' function are invalid."

Please can you help.

Thanks,

Jonathan

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...