Splunk Search

Can you help me with a search which only shows results that do not contain a specific value?

JoshuaJohn
Contributor

I want to see devices that do not have a specific value. I am organizing my devices by Mac Address, and I am trying to see the ones that do not have a profile named WifiProfile_X.

I keep getting the ones that do contain this profile, but I need to see the ones that dont.. any ideas?

index=nitro_apps source="DATA" | rex "^[^,\n]*,(?P<OG>[^,]+)[^,\n]*,(?P<MacAddress>[^,]+)(?:[^ \n]* ){4}(?P<Model>[^,]+),(?P<OS>[^,]+),\w+,(?P<Profile>[^,]+),\d+,(?P<Latest_Version>\d+),(?P<Installed_Date>[^,]+)[^,\n]*,(?P<Installed>\w+)"  | search OG=7 AND Model=180 AND Profile NOT "WifiProfile_X"
|stats list(MacAddress), list(Model), dc(MacAddress)
0 Karma

JoshuaJohn
Contributor

It was my regex... figured it out, thanks!

0 Karma

mstjohn_splunk
Splunk Employee
Splunk Employee

@joshuajohn

i'm glad you figured out the problem for yourself. Would you mind describing how you were able to fix your regex so that future users could learn from your process? Thanks.

0 Karma

Vijeta
Influencer

Hi,

Try using this search-

search OG=7 AND Model=180 AND Profile != "WifiProfile_X"

Thanks

0 Karma

JoshuaJohn
Contributor

Unfortunately no, this gives me every device in that location regardless of each devices settings.

0 Karma

Vijeta
Influencer

Do you want to list count of all distinct Mac address and also list all models and MacAddress by Profile? What does device settings refer to?

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!

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

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...