Splunk Search

filter blank events coming from syslog

mcafeesecure
Explorer

This is probably something simple that I am missing.

Is there a way to filter out what are esentially blank log entries from syslog?

I get messages with the timestamp and hostname, process/PID but no data.

Unfortunatly, I don't think this will be fixed in the app anytime soon, so I need a way to filter this out at search time, unfortunatly the PID is in the log so that's not uniform, and I can't filter out based on what IS there, as that would filter out the messages that do have data. Example log lines below.

Jan 13 10:21:39 hostname.domain.com process[PID]: data is here that I want
Jan 13 10:21:39 hostname.domain.com process[PID]: 

obviously I would want to keep the first, but discard the second

Tags (2)
0 Karma

Damien_Dallimor
Ultra Champion

You can filter out those syslog messages you don't want and route them to the null queue so they wont be indexed.

props.conf

[syslog_sourcetype]
TRANSFORMS-null= syslogfilter

transforms.conf

[syslogfilter]
REGEX = ^.+process\[\d+\]:$
DEST_KEY = queue
FORMAT = nullQueue

Check out this link at Splunk docs for more details

sbrant_tt
Explorer

This should work for what you're trying to do. If the "blank" message contains spaces, you may have to adjust the evaluation at the end but this is the general idea:

... | rex field=_raw "]:(?<message>.*)" | search message!=""
0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...