Getting Data In

how to blacklist events from file

gajananh999
Contributor

Hello All,

I am working on props.conf and transforms.conf files to clean some data before indexing the data into splunk so i have some data like

Version: 1.0

Fields: date time cs-method cs-uri sc-status cs-username cs(User-Agent) s-sitename s-ip s-port time-taken cs(Cookie) sc-substatus cs-host cs-version

Software: WebLogic

Start-Date: 2014-09-04 00:00:00

I want to exclude these lines while indexing data into Splunk. i know we can use blacklist and whitelist to exclude the files in inputs.conf file

Can anyone help me out here.

Thanks

0 Karma

yannK
Splunk Employee
Splunk Employee

Another option is the nullQueue filtering, but has more cost at indextime to parse all the events.

http://docs.splunk.com/Documentation/Splunk/6.1.3/Forwarding/Routeandfilterdatad#Discard_specific_ev...

0 Karma

gajananh999
Contributor

Hello Yannk,

nullQueue is not able to remove # lines from file here is the prop
9/17/01 1:02:50.000 AM

Example:

Version: 1.0

Fields: date time cs-method cs-uri sc-status cs-username cs(User-Agent) s-sitename s-ip s-port time-taken cs(Cookie) sc-substatus cs-host cs-version

Software: WebLogic

It taking this whole thing as one event

Thanks
Gajanan Hiroji

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Are you trying to ignore the preamble of a log file? If so, give PREAMBLE_REGEX in props.conf a shot. See http://docs.splunk.com/Documentation/Splunk/6.1.3/Data/Extractfieldsfromfileheadersatindextime#Props... for documentation.

martin_mueller
SplunkTrust
SplunkTrust

That should do it.

0 Karma

gajananh999
Contributor

Hello Martin,

will this work to remove lines from file which are starts with #?

PREAMBLE_REGEX=^#

Thanks
Gajanan HIroji

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...