Splunk Search

search using a regex

alexl1
Path Finder

hi, if I want to find events using a regex what is the syntax?

e.g if I want all events with either big or bag is there a way to use a regex like b.g

thanks,

Tags (1)
0 Karma
1 Solution

alexl1
Path Finder

I found it

regex _raw="b.g"

View solution in original post

0 Karma

grijhwani
Motivator

Actually, to find answer specific example the regex would in fact be "b[ai]g". Your example would find any combination of three printable characters starting with "b" and ending with "g", and would also return such things as "b-g", "bog", "b4g", etc...

Furthermore, your example would match anything containing words with a similar sequence, such as "begin", "bogus", "abigail", etc...

If you want to limit to complete words only you will need the start/end of word markers (< and >), which in the context of the config file may also require escaping with "\", as in this example:

regex _raw="\<b[ai]g\>"
0 Karma

alexl1
Path Finder

I found it

regex _raw="b.g"

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...