Splunk Search

How to rename fields having the same name in JOIN command?

piscriddo
New Member

Hi,

I am executing a right join on two searches. Unfortunately, both search results have the same field names.

How can I rename the field of one search only, and not the other, in order to be able to display these values in a table?

Example

Search A: 
Order_id = 123
Operation = authorize
Result = 200

Search B:
Order_id = 123
Operation = secure
Result = 200

I want to right join Search A to Search B in order to obtain:

order_id authorize secure
123 200 200

 

Thanks!

Labels (1)
Tags (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

It's often useful in Splunk to consider how you would do this without using join.

Typically to avoid join, you would include both data sets in the original search and then do aggregations on those as needed.

So, if you just had search A OR search B you would then be able to use @isoutamo 's chart statement to render the results.

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

you could try this:

| makeresults
| eval _raw="order_id, Operation, Result
123, authorize, 200
123, secure, 200" 
| multikv forceheader=1
| rename COMMENT as "prepare sample data"
| chart values(Result) as Result over order_id by Operation

r. Ismo 

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