Splunk Search

How to combine multiple field values to create single field name in eval statement.

jurjenterpstra
New Member

Hi,

I'm trying to combine the values of multiple fields to together form a single field name in an eval if statement.
Something like the example below.

Is that in any way possible?

Thanks for your help!

| eval {operation}_{merchant}_{country}=if((operation=operation AND country=country AND merchant=merchant), {operation}_{merchant}_{country}+1, 0)
Tags (2)
0 Karma

to4kawa
Ultra Champion
| makeresults
| eval _raw="operation merchant country
1 2 3
4 5 6
7 8 9
10 11 12"
| multikv
| table operation merchant country
| eval true_condition=$country$+1
| eval {operation}_{merchant}_{country}=if(1==0,$operation$."_".$merchant$."_".$true_conditon$,0)

This is a sample search.
Change the if search condition to suit your needs.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jurjenterpstra

Can you please share some sample data and expected results?

0 Karma

niketn
Legend

@jurjenterpstra In order for community to assist you better you should provide more context with your data. For example what are some of the sample data and what is the output you need.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...