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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...