Splunk Search

How to exclude fields for a stats graph

mrcportillo
Engager

Hi there,
I'm new in splunk, I have this portion of query with a stats function, but I just need some fields in the line chart.

     stats sum(TotalOK) as TOTALOK sum(TotalOKlw) as TOTALOKlw   by theTime | eval prom=(TOTALOKlw/3) | eval diferencia=prom-TOTALOK

Right now I have a line chart with all those fields, how can I exclude the field TOTALOKlw from the graph?.
Thanks in advance

Cheers

Tags (4)
0 Karma
1 Solution

aweitzman
Motivator

Tack the following onto the end of your search:

| fields - TOTALOKlw

So:

... 
| stats sum(TotalOK) as TOTALOK sum(TotalOKlw) as TOTALOKlw   by theTime 
| eval prom=(TOTALOKlw/3) 
| eval diferencia=prom-TOTALOK 
| fields - TOTALOKlw

View solution in original post

Raghav2384
Motivator

you can add a pipe at the end to exclude that field....something like

.....your search...|fields - TOTALOKlw

Hope this helps!

Thanks,
Raghav

0 Karma

aweitzman
Motivator

Tack the following onto the end of your search:

| fields - TOTALOKlw

So:

... 
| stats sum(TotalOK) as TOTALOK sum(TotalOKlw) as TOTALOKlw   by theTime 
| eval prom=(TOTALOKlw/3) 
| eval diferencia=prom-TOTALOK 
| fields - TOTALOKlw

woodcock
Esteemed Legend
... | fields - TOTALOKlw
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...