Getting Data In

How do I route data based on the Index field

mzorzi
Splunk Employee
Splunk Employee

Assuming I have a forwarder with inputs.conf:

[monitor:///var/log/notcritical]
index=datacritical

[monitor:///var/log/critical]
index=datanoncritical

How can I route the events from the two files into two different Splunk Indexers based purely on the value of Indexer field?

0 Karma
1 Solution

mzorzi
Splunk Employee
Splunk Employee

You should be able to forward based on value in the index field with this transforms.conf.

[send_to_critical]
SOURCE_KEY = _MetaData:Index
REGEX = datacritical
DEST_KEY = _TCP_ROUTING
FORMAT = critical

[send_to_noncritical]
SOURCE_KEY = _MetaData:Index
REGEX = datanoncritical
DEST_KEY = _TCP_ROUTING
FORMAT = noncritical

You the need to create a props.conf and make sure these two rules are applied to each event. You will then also need an outputs.conf with the two different tcpout groups, critical and noncritical.

View solution in original post

mzorzi
Splunk Employee
Splunk Employee

You should be able to forward based on value in the index field with this transforms.conf.

[send_to_critical]
SOURCE_KEY = _MetaData:Index
REGEX = datacritical
DEST_KEY = _TCP_ROUTING
FORMAT = critical

[send_to_noncritical]
SOURCE_KEY = _MetaData:Index
REGEX = datanoncritical
DEST_KEY = _TCP_ROUTING
FORMAT = noncritical

You the need to create a props.conf and make sure these two rules are applied to each event. You will then also need an outputs.conf with the two different tcpout groups, critical and noncritical.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...