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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...