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!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...