Splunk Search

Can't fillnull on fields in REST generated table?

the_wolverine
Champion

Why doesn't fillnull work here?

| rest /servicesNS/-/-/saved/searches splunk_server=local | search disabled=0 is_scheduled=1 | fillnull dispatch.earliest_time | table author, title, disabled, is_scheduled, cron_schedule, search, dispatch.earliest_time, dispatch.latest_time, actions, action.email, action.email.to, action.email.sendresults, alert.track, alert.expires, alert_type, realtime_schedule

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

dispatch.earliest_time isn't null so fillnull has nothing to do:

...  | eval a1 = if(isnull('dispatch.earliest_time'), "null", "not null")

Weirdly, it's zero-length at the same time:

...  | eval a2 = length(tostring('dispatch.earliest_time'))

And it's a string:

... | eval a3 = typeof('dispatch.earliest_time')

As a workaround, you can of course use eval dispatch.earliest_time = if(length('dispatch.earliest_time')=0, 0, 'dispatch.earliest_time').

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

dispatch.earliest_time isn't null so fillnull has nothing to do:

...  | eval a1 = if(isnull('dispatch.earliest_time'), "null", "not null")

Weirdly, it's zero-length at the same time:

...  | eval a2 = length(tostring('dispatch.earliest_time'))

And it's a string:

... | eval a3 = typeof('dispatch.earliest_time')

As a workaround, you can of course use eval dispatch.earliest_time = if(length('dispatch.earliest_time')=0, 0, 'dispatch.earliest_time').

martin_mueller
SplunkTrust
SplunkTrust

If that answers your question please do mark it as accepted.

0 Karma

the_wolverine
Champion

Thanks!!

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...