Splunk Search

Ignore null values

jackpal
Path Finder

I am using the nix agent to gather disk space.  I only collect "df" information once per day. I want to be able to present a statistics table that only shows the rows with values.  When I do the query below I get alot of empty rows.  I'd like to only show the rows with data.

index=os sourcetype=df host=hostname filesystem=*mapper*lim*
| eval LIM_PROD_DISK=case(
filesystem LIKE "%limproda1%", "limproda1",
filesystem LIKE "%limproda2%", "limproda2",
filesystem LIKE "%limprodwide0%", "limprodwide0",
filesystem LIKE "%limprodwide1%", "limprodwide1",
filesystem LIKE "%limprodwide2%", "limprodwide2",
filesystem LIKE "%limtoolsvol%", "limptoolsvol"
)
| bin _time span=1d
| timechart max(storage_used_percent) by LIM_PROD_DISK

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The timechart command has the cont option for that.  Try 

index=os sourcetype=df host=hostname filesystem=*mapper*lim*
| eval LIM_PROD_DISK=case(
filesystem LIKE "%limproda1%", "limproda1",
filesystem LIKE "%limproda2%", "limproda2",
filesystem LIKE "%limprodwide0%", "limprodwide0",
filesystem LIKE "%limprodwide1%", "limprodwide1",
filesystem LIKE "%limprodwide2%", "limprodwide2",
filesystem LIKE "%limtoolsvol%", "limptoolsvol"
)
| bin _time span=1d
| timechart cont=f max(storage_used_percent) by LIM_PROD_DISK

 

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The timechart command has the cont option for that.  Try 

index=os sourcetype=df host=hostname filesystem=*mapper*lim*
| eval LIM_PROD_DISK=case(
filesystem LIKE "%limproda1%", "limproda1",
filesystem LIKE "%limproda2%", "limproda2",
filesystem LIKE "%limprodwide0%", "limprodwide0",
filesystem LIKE "%limprodwide1%", "limprodwide1",
filesystem LIKE "%limprodwide2%", "limprodwide2",
filesystem LIKE "%limtoolsvol%", "limptoolsvol"
)
| bin _time span=1d
| timechart cont=f max(storage_used_percent) by LIM_PROD_DISK

 

---
If this reply helps you, Karma would be appreciated.
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 ...