Splunk Search

Not Like function !Like

navdeep1568
New Member

I am trying to search for a server which is named differently than all the others in our network. Commonly servers are named with Location followed by 4 digits and then some string in the end (Eg: Flra2209php_ua).

If one of the machines is not following this naming convention, how do I search for it? I was hoping there would be a "not like" function which might help with this?

Tags (2)
0 Karma

vnravikumar
Champion

Hi @navdeep1568

Try this

| makeresults 
| eval server="Flra2209php_ua,Flra2209" 
| makemv delim="," server 
| mvexpand server 
| where NOT match(server,"\w+\d{4}\S+")
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try regex. Use | regex Name!="\w{4]\d{4}.*" to exclude events where the "Name" field doesn't contain four alphanumerics, then four digits, and then any text.

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...