Splunk Search

Add a column to search (stats)

rzpotschien
New Member

Hi there,

I have a table with some columns. Splunk should show a new column with a dynamic value.
When the value of source is Aruba than Splunk should fill the value in the new columns with ABC.
When the value of source is dell than Splunk should fill the value in the new columns with DEF.
and so on...

source="Aruba" OR source="dell" | table source
(simplified search)

Is it possible in Splunk?

Thanks in advance.

Splunk Version 6.3

Tags (1)
0 Karma

somesoni2
Revered Legend

I guess you're looking for an "EVAL - IF" OR "EVAL -CASE" statement

source="Aruba" OR source="dell" | table source | eval newfield=if(source="Aruba","ABC","DEF")

source="Aruba" OR source="dell" | table source | eval newfield=case(source="Aruba","ABC", source="dell" ,"DEF", 1=1, "Unknown" )
0 Karma
Get Updates on the Splunk Community!

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

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

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