Getting Data In

inputs.conf TCP One port multiple indexes ?

Silah
Path Finder

Hey all

I am taking input over TCP by having this in my inputs.conf

 

[tcp://1.2.3.4:123]
connection_host = ip
index = index1
sourcetype = access_combined

 

My question is, can I have the same port send data to multiple indexes? Ie. without opening additional ports on my firewall, can I have another host send data to the same port but land in a different index?

I tried adding this

 

[tcp://5.6.7.8:123]
connection_host = ip
index = index2
sourcetype = access_combined

 

but that just stopped the ingestion altogether.

Thanks.

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @Silah ,

ok, you can use syslog using different stanzas as you did,

if the second one doesn't run, check if the firewall routes are open, you can check this using telnet on the source systems.

In addition I hint to use an rsyslog or a syslog-ng server to take syslog events, instead Splunk TCP inputs, writing them on files and then reading those files with the HF; in this way you can continue to receive logs even if Splunk is down or in maintenance and you'll have less issue for the load of the Splunk Server.

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @Silah ,

yes you can create two different stanzas, one for each sender with different indexes.

The only question is: why?

usually index are choosen when you have different retentions or different access grants, not different sources or technologies.

Different sources are recognized in the same index by host and different technologies are recognized by sourcetype.

Ciao.

Giuseppe

0 Karma

Silah
Path Finder

Thanks Guiseppe

The Why: I do need different access grants for one, and I have limitations I am trying to overcome. My heavy forwarders are behind firewall and I have a directive to reduce as far possible the amount of ports open, and ideally I want as little software footprint as possible (so no  splunk agents installed on the app servers) so I am trying to use existing syslog forwarder. The TCP forwarding is working fine for the POC but I need to scale it.

Forgive my ignorance reg stanzas, but is that not I tried to do? adding the second [tcp://5.6.7.8:123] ? This didn't work

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Silah ,

ok, you can use syslog using different stanzas as you did,

if the second one doesn't run, check if the firewall routes are open, you can check this using telnet on the source systems.

In addition I hint to use an rsyslog or a syslog-ng server to take syslog events, instead Splunk TCP inputs, writing them on files and then reading those files with the HF; in this way you can continue to receive logs even if Splunk is down or in maintenance and you'll have less issue for the load of the Splunk Server.

Ciao.

Giuseppe

Silah
Path Finder

Thanks, I figured it out using the stanzas.

Don't know if this is the "sanctioned" way but if anyone else are interested, what solved it for me was adding host to each. Without it, it wouldn't work.

So changing this format

[tcp://1.2.3.4:123]
connection_host = ip
index = index1
sourcetype = access_combined

To this:

 

 

[tcp://1.2.3.4:123]
connection_host = ip
host = 1.2.3.4
index = index2
sourcetype = access_combined
[tcp://5.6.7.8:123]
connection_host = ip
host = 5.6.7.8
index = index2
sourcetype = access_combined

 

 

 

0 Karma
Get Updates on the Splunk Community!

New This Month in Splunk Observability Cloud - Metrics Usage Analytics, Enhanced K8s ...

The latest enhancements across the Splunk Observability portfolio deliver greater flexibility, better data and ...

Alerting Best Practices: How to Create Good Detectors

At their best, detectors and the alerts they trigger notify teams when applications aren’t performing as ...

Discover Powerful New Features in Splunk Cloud Platform: Enhanced Analytics, ...

Hey Splunky people! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2408. In this ...