Splunk Search

How to Filter on Null Values?

katzr
Path Finder

Hello, I am trying to filter on null values for the field called Device. None of the following searches below work- can you please help me figure out another way to do this?

NOT Device="asterick"
Device!="asterick"
Device=""

Note: I actually put an asterick in the middle of those searches (*) but I typed out asterick because it was changing my formatting of this question

DalJeanis
Legend

Here's some ways to mark code so that the interface doesn't mess with it.

1) use the code button (101 010) to mark code (works in Chrome)

2) If it is multiple lines, you can put at least four spaces before each line.

3) For small snatches of code, you can use the grave accent "" that is under the tilde(~) on an American keyboard. Place the gave accent before and after the small stretch of code to mark it ascode`.

0 Karma

cmerriman
Super Champion

use |where isnull(Device) to get all events where Device is null and |where isnotnull(Device) or |search Device=*/index=A Device=* to get all events where Device is not null.

s2_splunk
Splunk Employee
Splunk Employee
NOT Device="*" should give you all events that don't have the field "Device". Field names are case-sensitive, is the field you want to filter out exactly called "Device"?

Can you show us a couple of sample events, indicating which ones you don't want?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...