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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...