Splunk Search

Writing a regular expression to capture null values

mahbs
Path Finder

Hi,

I've got fields which contain null values. I'm writing a regular expression to capture instances where fields contain null values.

This is what I have, but it's not working.
^(^.){0}$
I'm trying to say in this expression, looking something that's empty. But as mentioned before, it's not working. I'm not too sure how null works in splunk.

Could someone please help me with this?

Thanks
Mahbs

Tags (1)
0 Karma

micahkemp
Champion

Do you want to find events like:

fieldyoucareabout= otherfield1=value1 otherfield2=value2

Or instead:

otherfield1=value1 otherfield2=value2

0 Karma

elliotproebstel
Champion

Have you tried using your base search | where isnull(fieldname) syntax rather than regular expressions? You can use this to find events with null values for any number of fields by chaining them like this: your base search | where isnull(fieldname) OR isnull(field2name)...

0 Karma

niketn
Legend

@mahbs, can you add sample events and also your current code using the code button (101010) on Splunk Answers, so that special characters do not escape?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...