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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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