Dashboards & Visualizations

forwarder with regex

simo
Path Finder

Hi All,

my solution foresees a heavy forwarder that sends data to an indexer, in the transforms.conf file I have a regex, which allows me to filter through string only the lines I need

regex example
REGEX = ^.*(?:SIMONE|MARCO).*

file.log example to monitor
xxxxx|xxxxx|xxxxx|SIMONE|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|VALERIO|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|SILVIA|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|MARCO|xxxxx|xxxxx|xxxxx

I am acknowledging these errors

ERROR Regex - Failed in pcre_exec: Error PCRE_ERROR_MATCHLIMIT for regex:
WARN regexExtractionProcessor - Regular expression for stanza xxxxx exceeded configured PCRE match limit. One or more fields might not have their values extracted, which can lead to incorrect search results. Fix the regular expression to improve search performance or increase the MATCH_LIMIT in props.conf to include the missing field extractions.

I wanted to know if there is a different way to filter the data to send without regex?

Best Regards,
Simone

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try your regex without the greedy .* since this is implied i.e. the expression will be matched anywhere in the event

REGEX = (?:SIMONE|MARCO)

 

0 Karma

simo
Path Finder

Hi @ITWhisperer,

Thanks for the reply, I would like to remove the regex to filter. it's possible?

in the regex it is also present

REGEX = (?:SIMONE|MARCO|SIMONE.*HOME)

xxxxx|xxxxx|SIMONE|xxxxx|HOME|xxxxx

 

Simone

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

REGEX = (?:SIMONE|MARCO|SIMONE.*HOME) This part is irrelevant since xxxxx|xxxxx|SIMONE|xxxxx|HOME|xxxxx will match with the first alternative

0 Karma

simo
Path Finder

sorry my example is incorrect

REGEX = (?:SIMONE|MARCO|DANIELE.*HOME)

xxxxx|xxxxx|DANIELE|xxxxx|HOME|xxxxx
xxxxx|xxxxx|DANIELE|xxxxx|OFFICE|xxxxx
xxxxx|xxxxx|xxxxx|SIMONE|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|VALERIO|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|SILVIA|xxxxx|xxxxx|xxxxx
xxxxx|xxxxx|xxxxx|MARCO|xxxxx|xxxxx|xxxxx

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

That is the correct expression to match the bold events

0 Karma

simo
Path Finder

ok, but it is possible to filter without regex?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Yes, you just make the REGEX match anything

REGEX = .

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Are you sure your data is properly broken into events?

It looks as if you were processing a huge chunk of data at once thus hitting too many matches.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...