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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...