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!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...