Getting Data In

How can I redirect traffic based on host AND sourcetype with props/transforms?

daniel333
Builder

All,

Is there a way to route traffic based on host AND sourcetype?

if sourcetype="abc" AND host="zxc" then index=compliance
if sourcetype="abc" and NOT host=zbx then index=web

0 Karma

FritzWittwer_ol
Contributor

You can use a combination: in props.conf you setup a transform based on the source type, and then have a regex on the host in transform, so the transform is only applied for some hosts. Of course you could as well do it the other way around by having a prosp.conf entry for the hosts and the regex on the sourcetype in transforms.conf

props.conf

[abc]
TRANSFORMS-abc_conditional_routing = TRANSFORMS-abc_conditional_routing

transforms.conf

[TRANSFORMS-abc_conditional_routing]
SOURCE_KEY = MetaData:Host
REGEX = zxc
DEST_KEY = _MetaData:Index
FORMAT = web
0 Karma
Get Updates on the Splunk Community!

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 ...

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...