Reporting

Add a new field/table column with preset data (conditional)

phamxuantung
Communicator

I'm extracting data from a raw log and put it on a table, now I want to add a column that indicate the action that admin should take if a port is downed, it's kind of like this

 

 

Time|System|Domain|Status    |Action
--------------------------------
XXX |XXX   |XXX   |DOWN      |Call IT
XXX |XXX   |XXX   |infiltrate|Call Security

 

 

In here, the Action field/column is a newly created data that not in the raw log but generated based on the Status's value, like "Call IT" if the Status is DOWN, or "Call Security" if Status is Infiltrate.

Is there anyway to archive this?

Labels (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @phamxuantung,

You can create Action field based on Status fields adding below eval command;

| eval Action=case(Status="DOWN","Call IT",Status="infiltrate","Call Security")

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

scelikok
SplunkTrust
SplunkTrust

Hi @phamxuantung,

You can create Action field based on Status fields adding below eval command;

| eval Action=case(Status="DOWN","Call IT",Status="infiltrate","Call Security")

 

If this reply helps you an upvote is appreciated.

If this reply helps you an upvote and "Accept as Solution" is appreciated.

phamxuantung
Communicator

Thank you, that's exactly what I need

0 Karma
Get Updates on the Splunk Community!

Celebrating Fast Lane: 2025 Authorized Learning Partner of the Year

At .conf25, Splunk proudly recognized Fast Lane as the 2025 Authorized Learning Partner of the Year. This ...

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...