Getting Data In

Why is this props.conf not stripping headers for bro logs?

croose
Engager

Am I missing something? My understanding of splunk 6 is that the following configuration should strip all lines beginning with '#' and parse the line beginning with '#fields' for field names, starting after the text #fields[tab]. However, headers are not being stripped and fields are being parsed beginning with #fields, so they are one column off. I think I need some assistance from someone who understands splunk better than me, because I'm going crazy trying to understand why this isn't working.

props.conf:
[brolog]
PREAMBLE_REGEX=^#
FIELD_HEADER_REGEX=^#fields\t
FIELD_DELIMITER=\t
MISSING_VALUE_REGEX=-

alaorath
Path Finder

I had almost the exact same issue (although my "header block" was only 2 lines).
I found that no variations of PREAMBLE_REGEX (despite passing the regex101.com test) would properly filter out the header lines... UNTIL I added HEADER_FIELD_LINE_NUMBER as well.

After experimenting, I found that any value of HEADER_FIELD_LINE_NUMBER worked (as long as it wasn't greater than the actual header block... <=3 in my case)

The exact settings I ending up using:

HEADER_FIELD_LINE_NUMBER=1
PREAMBLE_REGEX=^#.*

My log file looks something like:

# Created on Jan 1, 2014
# Created by /opt/procys/ProcessResults.sh
2014-01-01 00:00 Something, something, normal log data here
2014-01-01 01:00 Something, something, normal log data here
2014-01-01 02:00 Something, something, normal log data here
0 Karma

the_wolverine
Champion

But I don't see a header field in your sample log file. Did you just leave it out?

0 Karma

jjensenyahoo
Explorer

By no means an expert, but reading the docs, seems like you need to:

  1. in PREAMBLE_REGEX, specify the regex to match the whole line to throwaway.. perhaps ^#.*
  2. in FIELD_HEADER_REGEX, need to regex capture the actual part of the line which has the field headers to extract, perhaps ^#fields\t(.*)

http://docs.splunk.com/Documentation/Splunk/6.0.3/Data/Extractfieldsfromfileheadersatindextime

Ayn
Legend

Also are you doing this on a forwarder or an indexer?

0 Karma

yannK
Splunk Employee
Splunk Employee

please paste a sample of your actual logs.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...