Splunk Search

how to set null value ?

WXY
Path Finder

If the field value is null, the value is null, and if it is not controlled, it is still the original value

I want to get a field value ,if it is null ,I set it null,if not ,I hope it still the original value

I use :

index = abc_text  | eval Codelocation = if(isnull(Codelocation), "null",Codelocation)|stats  max(_time) as _time  values(Codelocation) as codelocation by source

It did not achieve the desired effect.

Tags (3)
0 Karma

zihenggong
Engager

use null() instead of "null"

renjith_nair
Legend

@WXY, just a clarification - if the value is null why do you want to set it again to null ? Do you mean you want to convert "space" to null.

Anyway try this |eval Codelocation = if(isnull(Codelocation), null(),Codelocation)

---
What goes around comes around. If it helps, hit it with Karma 🙂
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...