Splunk Search

help on token which has to return empty values

jip31
Builder

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

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

scelikok
Champion

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 is appreciated.

View solution in original post

0 Karma

scelikok
Champion

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 is appreciated.

View solution in original post

0 Karma
Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!