Getting Data In

Can anyone please explain the purpose of 'usenull' keyword with an example?

gopi_c
New Member

I've have been trying to search the use of 'usenull' keyboard. Could anyone explain this please.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

From the docs (https://docs.splunk.com/Documentation/Splunk/7.2.6/SearchReference/ListOfDataTypes):

usenull controls whether or not a series is created for events that do not contain the split-by field. This series is labeled by the value of the nullstr option, and defaults to NULL.

usenull is enabled by default so you only need to add usenull=f when you have a chart with "NULL" that you don't want.

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

niketn
Legend

One of better ways to remove NULL series being created in the timechart/chart because of null values in the split by field is to apply field filter before the timechart/chart command.

For example try the following two run anywhere searches based on Splunk's _internal index.

index=_internal sourcetype=splunkd earliest=-30s latest=now
| timechart span=10s count by cumulative_hits limit=0 useother=f


index=_internal sourcetype=splunkd earliest=-30s latest=now cumulative_hits=* 
| timechart span=10s count by cumulative_hits limit=0 useother=f
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...