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!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...