Splunk Enterprise

How to remove fields with zero value in chart command?

marysan
Communicator

Hello everybody 
my query :

 

index=logarithm SrcAddr="192.168.148.1"
|eval flag=case(DestAddr="192.168.148.7" OR DestAddr="192.168.148.8" OR DestAddr="192.168.148.24" ,"LAN 1",DestAddr="192.168.148.21" OR DestAddr="192.168.148.36" OR DestAddr="192.168.148.37" ,"LAN 4" , DestAddr="192.168.148.33" OR DestAddr="192.168.148.34" OR DestAddr="192.168.148.35","LAN 5")
|chart count over flag by DestAddr useother=f usenull=f

 



and in trellis mode there are all DestAddrs for each flag! (as we can see in picture)
but I want not to show DestAddrs with 0 values in every chart 
by "LAN 1" just show "192.168.148.7" or  "192.168.148.8"  or "192.168.148.24"
by "LAN 4" just show "192.168.148.21" or  "192.168.148.36"  or "192.168.148.37"
by "LAN 5" just show "192.168.148.33" or  "192.168.148.34"  or "192.168.148.35question.png"

Labels (1)
Tags (1)
0 Karma
1 Solution

marysan
Communicator

this problem was resolved by using |stats count as count by flag, DestAddr 

View solution in original post

0 Karma

marysan
Communicator

this problem was resolved by using |stats count as count by flag, DestAddr 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Have you tried adding | where count > 0 to the end of the query?

---
If this reply helps you, Karma would be appreciated.
0 Karma

marysan
Communicator

yes
it doesn't work . shows nothing !

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...