Getting Data In

Ignoring Comments in Log Files

enielson
Explorer

I am trying to index the httperr files from IIS, located in C:\windows\system32\LogFiles\HTTPERR but each of those files start with a set of lines that begin with a #.

How can I instruct splunk to ignore lines starting with #?

Tags (1)
1 Solution

silvermail
Path Finder

Adding to the answer, this is what I am using.

props.conf

[iis]
KV_MODE = none
CHECK_FOR_HEADER = false
TRANSFORMS-commentsToNull = iis-ignore-comments
REPORT-iisfields = iis-w3c-extended-fields
TIME_FORMAT = %Y-%m-%d %H:%M:%S

transforms.conf

[iis-ignore-comments]
REGEX = ^#(?:Version|Software|Fields|Date):\s.*$
DEST_KEY = queue
FORMAT = nullQueue

View solution in original post

paul_1994
Path Finder

Was this done on the indexer? or the search head? It seems like it should happen on the indexer but I wanted to make sure..

0 Karma

paul_1994
Path Finder

Thanks. I made the change on my indexers and it seems to be working in our test environment.

0 Karma

Paolo_Prigione
Builder

The filtering has to be configured by the instance which parses the data. If you have intermediate heavy forwarder, they are parsing. If the Universal forwarder sends directly to indexers, they are the ones parsing.

0 Karma

silvermail
Path Finder

Adding to the answer, this is what I am using.

props.conf

[iis]
KV_MODE = none
CHECK_FOR_HEADER = false
TRANSFORMS-commentsToNull = iis-ignore-comments
REPORT-iisfields = iis-w3c-extended-fields
TIME_FORMAT = %Y-%m-%d %H:%M:%S

transforms.conf

[iis-ignore-comments]
REGEX = ^#(?:Version|Software|Fields|Date):\s.*$
DEST_KEY = queue
FORMAT = nullQueue

slierninja
Communicator

This worked out beautifully, I also had to add iis-2, iis-10, and other iis-* source types that I was using to props.conf.

0 Karma

dwaddle
SplunkTrust
SplunkTrust
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...