Splunk Search

How to write a regular expression to filter out field values starting with "note-", followed by more than 15 characters?

kiran331
Builder

Hi

I want to exclude the field values starting with "note-" and more than 15 characters after it. How can I write the regex for this.

eg:

device
note-acv234454dfgdfg
note-dfdffgfghffe4353456

0 Karma
1 Solution

sundareshr
Legend

Does it have to be in regex? You could extract all the fieldvalues and then filter out using where Like this

... | rex (?<device>captureeverything> | where NOT match(device, "note*") OR len(device)<15

View solution in original post

somesoni2
Revered Legend

You can try like this

your base search | regex yourfield!="^note-\w{15}.*"

sundareshr
Legend

Does it have to be in regex? You could extract all the fieldvalues and then filter out using where Like this

... | rex (?<device>captureeverything> | where NOT match(device, "note*") OR len(device)<15
Get Updates on the Splunk Community!

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...

Getting Started with Splunk Artificial Intelligence, Insights for Nonprofits, and ...

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

Splunk Observability Cloud’s AI Assistant in Action Series: Identifying Unknown ...

Agentic AI powers the Splunk AI Assistant within the Splunk Observability Cloud interface to help you quickly ...