Dashboards & Visualizations

How to get two different field names

aditsss
Motivator

Hi Everyone,

I am using below query:

index=abc  ns=blazegateway|stats count by app_name|eval f1="hg"

I am getting result as :

app_name                     count                  f1

abc                                       1                          hg

bcd                                          2                         hg

My requirement is for my column f1 I am getting hg in both rows I want some other name in 2nd row

What changes I should do in my query

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Depending on how you determine what value should go in f1, you could use a case function, e.g.

 

| eval f1=case(app_name="abc","hg")
| eval f2=case(app_name="bcd","xy")

 

View solution in original post

aditsss
Motivator

@ITWhisperer 

 

Thank you so much

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Depending on how you determine what value should go in f1, you could use a case function, e.g.

 

| eval f1=case(app_name="abc","hg")
| eval f2=case(app_name="bcd","xy")

 

Get Updates on the Splunk Community!

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

 Prepare to elevate your security operations with the powerful upgrade to Splunk Enterprise Security 8.x! This ...

Get Early Access to AI Playbook Authoring: Apply for the Alpha Private Preview ...

Passionate about security automation? Apply now to our AI Playbook Authoring Alpha private preview ...

Reduce and Transform Your Firewall Data with Splunk Data Management

Managing high-volume firewall data has always been a challenge. Noisy events and verbose traffic logs often ...