Splunk Search

How to write regex to exclude indexing files that start with a period (.)?

dhavamanis
Builder

Can you please tell us REGEX pattern, to exclude files for indexing that start with a period (.) ?

Tags (3)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

The simplest is to use a blacklist:

blacklist = \/\.[^\/]*$

but you could also use (more complicated):

whitelist = \/(?!\.)[^\/]*$

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

The simplest is to use a blacklist:

blacklist = \/\.[^\/]*$

but you could also use (more complicated):

whitelist = \/(?!\.)[^\/]*$

ShaneNewman
Motivator
^(?!\.)
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

or use the blacklist parameter with blacklist = \/\.[^\/]*$

0 Karma

ppablo
Retired

I'm sure some regex experts out there can help you solve your question, but a lot of them would definitely recommend using http://regex101.com or http://www.regexr.com
to learn how to create your own regex patterns instead of getting a simple copy and paste answer.

0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

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

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 ...