Splunk Search

Rename field values in one column, insert them into a different column, and get a list view of both columns

cmp_analyst
Observer

I would like to rename the field values that exist in one column and add them into their own separate column while keeping the original column (with the values before they were renamed) to show how they map to the new values in the new column.

The idea is if I have a list of IDs (original) that I want to map to different names in a separate column that represent those original IDS (basically Aliases) but want to keep both of the columns in a list view, how would I go about doing that?

Example: Display

Original IDsNewIDs
P1DPopcorn
B4DBanana
O5DOpp
Labels (3)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If you need to preserve the original field then you aren't renaming.  Use the eval function to create a new field based on the old one.

| eval NewIDs = case(OriginalIDs="P1D", "Popcorn",
                     OriginalIDs="B4D", "Banana",
                     OriginalIDs="O5D", "Opp",
                     1==1, OriginalIDs)

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...