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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...