Getting Data In

How do I filter by three fields then do rerouting at the same time?

nethern
New Member

How do I filter by host name, source type, and message match regex, then rerouting at the same time?

I want to achieve this:

For each event, if
1) host name is one of host1, host2 and
2) sourcetype is "linux:messages" and
3) message matches "Application:\s(Error|Warning)" regex
then go to index cluster 2

How do i do that? I can see a lot of other similar questions about filtering and rerouting, but none deals with three conditions.

0 Karma

FrankVl
Ultra Champion

I'm not aware of any way to do this for 3 'fields'. You can do a sourcetype triggered transforms, and use the REGEX on the host field (to cover your 2nd condition) or use the REGEX on the raw message (to cover your third condition).

If the hostname is also in the raw event, of course, you could incorporate that into your regex, e.g. something like (host1|host2).*Application:\s(Error|Warning). But the more hostnames involved, the uglier (and slower) that gets of course...

0 Karma

nethern
New Member

The events don't contain host names there. Can't each stanza in transforms.conf apply two transforms? or grouping two into one?

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...