Splunk Search

Syslog Filteration

novotxms
Loves-to-Learn

We are receiving around 300gigs of syslog data everyday and we want to filter all the logs and index only what the network team wants us to. what is the configuration changes that can help me to achieve this? 

 

How do I filter all the unnecessary logs from the syslog server?

I just need to index the events, where one of the field says sgt=4

 

Thanks & Regards,

Manyutej Sanjeev

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @novotxms,

You can try sample below;

https://docs.splunk.com/Documentation/Splunk/8.1.2/Forwarding/Routeandfilterdatad#Keep_specific_even... 

[source::/var/log/messages]
TRANSFORMS-set= setnull,setparsing

transforms.conf
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = sgt\=4
DEST_KEY = queue
FORMAT = indexQueue

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma

novotxms
Loves-to-Learn

Any other answers please? 

0 Karma

Vardhan
Contributor

Hi,

You can use the below filter in the Syslog config. And it will filter only required logs.

filter test{ match( "sgt=4" value("MESSAGE"));};

If you need to add an additional filter you can just use OR operation.

filter test{ match( "sgt=4" value("MESSAGE")); or match( "provide your keyword" value("MESSAGE"));};

if this answer helps you then upvote it.

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...