Splunk Search

Search results include fields with no values, can this be done?

DanielFordWA
Contributor

Is it possible to get search results in a table when only some of the results will have all the fields associated with them?

Currently I cannot get this to work.

For example....

DateTimeUserURLTermProduct
15/05/201310:01:02User123456/Home/--
15/05/201310:01:32User123456/Products/--
15/05/201310:01:53User123456/Products/Product1/-ID12345678
15/05/201310:02:42User123456/Search/--
15/05/201310:03:12User123456/Search/Results/Car-
0 Karma
1 Solution

Ayn
Legend

fillnull?

... | fillnull value="-" Term Product | ...

View solution in original post

wpreston
Motivator

I usually use eval to handle these. Something like:

...my search params... | eval TermProduct=if(isnull(TermProduct),"None",TermProduct) | ...other search params...

then adjust your search to account for "None" (or whatever you want to eval it to) in that field.

Ayn
Legend

fillnull?

... | fillnull value="-" Term Product | ...

Ayn
Legend

You need fillnull before your stats command, not after.

0 Karma

DanielFordWA
Contributor

If in my search query I use the below...

stats count by Date Time User URL Term | Fields Date Time User URL Term | fillnull value="-" Term

This will only return the last result on the above table. The previous 4 results do not have the field "Term" associated with them, however I would like these to populate with a blank if that is the case.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...