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!

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...