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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...