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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...