Splunk Search

help on token which has to return empty values

jip31
Motivator

hello

 

I use a scheduled search where I stats events like this :

| stats last(LastReboot) as "Last reboot date" by host CATEGORY DEPARTMENT 

For the moment, in DEPARTMENT field I have a lot of empty fields

In the dashboard, I call my scheduled search and I use token filters

| loadjob savedsearch="admin:SA_XXX_sh:LogLogon" 
| search CATEGORY=$tok_filtercategory|s$ 
| search DEPARTMENT=$tok_filterdepartment$ 

What I dont understand is why the events are not displayed if DEPARTMENT fiel is empty?

Thanks

Tags (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @jip31,

stats command cannot group empty fields, you can try below;

| fillnull value="empty" DEPARTMENT
| stats last(LastReboot) as "Last reboot date" by host CATEGORY DEPARTMENT
If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @jip31,

stats command cannot group empty fields, you can try below;

| fillnull value="empty" DEPARTMENT
| stats last(LastReboot) as "Last reboot date" by host CATEGORY DEPARTMENT
If this reply helps you an upvote and "Accept as Solution" is appreciated.
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 ...