Splunk Enterprise

How to Use Regex and stop the logs reaching Splunk in this Scenario

anandhalagarasa
Path Finder

Hi ,

We want to filter the following data using REGEX in props.conf and tansforms.conf but still the data is coming into Splunk. We have tried few methods but still logs are reaching splunk so kindly help on this request.

Tags (1)
0 Karma
1 Solution

skoelpin
SplunkTrust
SplunkTrust

Put this in your transforms.conf

[GET-to-nullQueue]
 REGEX=\d+\s\-\s-\s\d{3}
 DEST_KEY=queue
 FORMAT=nullQueue

Place this in your props.conf

[YOUR_Sourcetype]
 TRANSFORMS-t1=GET-to-nullQueue

Restart your Splunkd service for the changes to take affect.. This will not work retroactively, this will only work on new events coming in

View solution in original post

DalJeanis
Legend

So which way do you want the decision made? Pick one -

A) Kill anything that starts with GET
B) Keep anything that starts with POST
C) Keep anything that has Java/* in that position.

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Put this in your transforms.conf

[GET-to-nullQueue]
 REGEX=\d+\s\-\s-\s\d{3}
 DEST_KEY=queue
 FORMAT=nullQueue

Place this in your props.conf

[YOUR_Sourcetype]
 TRANSFORMS-t1=GET-to-nullQueue

Restart your Splunkd service for the changes to take affect.. This will not work retroactively, this will only work on new events coming in

horsefez
Motivator

skoelpins regex is right, but you could also use this visually more pleasing one
REGEX=(?=(?>\s\-\s\-\s))

just sayin :3

0 Karma

inventsekar
SplunkTrust
SplunkTrust

Hi Anand, please update us your current props.conf, so that we can understand your current configuration and suggest.

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

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