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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...