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!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...