Getting Data In

Help with Parsing props.conf and transforms.conf

dsofoulis
Path Finder

Hi Everyone,

I cannot figure what I am doing wrong.
I am using pfsense and I am receiving the logs into splunk but the logs are not being formatted.

This is the event which I am receiving in splunk

Nov 10 20:12:12 FWPFS001.localdomain Nov 11 15:12:12 filterlog: 84,16777216,,1000003811,igb0,match,pass,out,4,0x0,,127,2445,0,none,17,udp,1378,192.168.0.100,216.58.199.46,28180,443,1358

As you can see it is not being tagged with what is configured in the props.conf and transforms.conf

Here are my config files.

[syslog]
SHOULD_LINEMERGE = true
TRUNCATE = 0
MUST_NOT_BREAK_AFTER = pf: .* rule ([-\d]+\/\d+)(.?):
MUST_BREAK_AFTER = pf: .
(<|>) +(\d+.\d+.\d+.\d+).?(\d*):
REPORT-pf2 = pf2

Transforms.conf
[pf2]

REGEX= .* (?pass|block) .* (?TCP|UDP|IGMP|ICMP) .* (?(\d+.\d+.\d+.\d+)).?(?(\d*)) <|>.?(?(\d*)): (.*)

Any help is greatly appreciated.

0 Karma

Gilberto_Castil
Splunk Employee
Splunk Employee

It is unclear if the regular expression works, or if the markup formatting ate parts of what is visible. Regardless, your transforms.conf stanza may not be complete.

Let us assume that you want to create a report for three basic fields: action, protocol and source ip. In this case we are making an assumption that the desired matches are as follows:

Nov 10 20:12:12 FWPFS001.localdomain Nov 11 15:12:12 filterlog: 84, 16777216, , 1000003811, igb0, match, pass,out,4,0x0,,127,2445,0,none,17, udp,1378, 192.168.0.100, 216.58.199.46,28180,443,1358

In this case, the corresponding props.conf entry will be:

[syslog]
...
REPORT-pf2 = pf2

And, the transforms.conf entry is as follows:

[pf2]
REGEX = .+?(pass|block).+?(tcp|udp|igmp|icmp).+?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})
FORMAT = action::$1 protocol::$2 src::$3

That should do it. At this point, the data should be represented cleanly in user interface.

I hope this helps you,

-gc

0 Karma

jawadak
New Member

If I want to create a report with action, protocol, source ip and destination ip. What should I add in the transforms.conf?

0 Karma
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 ...