Getting Data In

How can I send logs from one universal forwarder to two different indexers depending on the logs type?

raindrop18
Communicator

I am planning to send the logs to multiple Splunk indexers (location) based on the logs type from one universal forwarder

example

    server-1         myapp1.log  -> indexer-South
                     myapp2.log -> indexer-south
                     myapp3.log -> indexer-east
                     myapp4.log - > indexer-east

   server-2         myapp1.log  -> indexer-South
                     myapp2.log -> indexer-south
                     myapp3.log -> indexer-east
                     myapp4.log - > indexer-east

can this be done? I would like some feedback how to do that.

thanks

0 Karma
1 Solution

TStrauch
Communicator

Hi,

yes you can do this.

You need to create two output.conf stanzas

[tcpout:south]
 server=server_south:9997
 [tcpout:east]
 server=server_east:9997

Then you need to do a TCP_routing in inputs.conf

[monitor://path/myapp1.log]
 _TCP_ROUTING = south
[monitor://path/myapp3.log]
 _TCP_ROUTING = east

Hope this helps. You have to create a input stanza for each log in this example. But can also do the matching via Regex to reduce the amount of input stanzas.

kind regards

View solution in original post

TStrauch
Communicator

Hi,

yes you can do this.

You need to create two output.conf stanzas

[tcpout:south]
 server=server_south:9997
 [tcpout:east]
 server=server_east:9997

Then you need to do a TCP_routing in inputs.conf

[monitor://path/myapp1.log]
 _TCP_ROUTING = south
[monitor://path/myapp3.log]
 _TCP_ROUTING = east

Hope this helps. You have to create a input stanza for each log in this example. But can also do the matching via Regex to reduce the amount of input stanzas.

kind regards

raindrop18
Communicator

perfect,thanks much TStrauch

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