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!

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...

AI for AppInspect

We’re excited to announce two new updates to AppInspect designed to save you time and make the app approval ...

App Platform's 2025 Year in Review: A Year of Innovation, Growth, and Community

As we step into 2026, it’s the perfect moment to reflect on what an extraordinary year 2025 was for the Splunk ...