Commit a0732ac9 by e0d

refactoring to support multiple forward targets

parent f54c73d2
......@@ -16,12 +16,15 @@
#
splunk_role_name: 'splunk'
SPLUNKFORWARDER_SERVER: 'localhost:9997'
SPLUNKFORWARDER_PACKAGE_URL: !!null
SPLUNKFORWARDER_DEB: !!null
SPLUNKFORWARDER_PASSWORD: !!null
SPLUNKFORWARDER_SERVERS:
- target_group: "default_output_server"
server: "localhost:9997"
default: true
SPLUNKFORWARDER_LOG_ITEMS:
- source: '{{ COMMON_LOG_DIR }}/lms'
recursive: true
......
# {{ ansible_managed }}
[default]
host = {{ansible_hostname}}
host = {{ ansible_hostname }}
{% for loggable in SPLUNKFORWARDER_LOG_ITEMS%}
[monitor://{{loggable.source}}]
recursive = {{loggable.recursive|default(false)}}
[monitor://{{ loggable.source }}]
recursive = {{ loggable.recursive|default(false) }}
{% if loggable.sourcetype is defined %}
sourcetype = {{loggable.sourcetype}}
sourcetype = {{ loggable.sourcetype }}
{% endif %}
{% if loggable.index is defined %}
index = {{loggable.index}}
index = {{ loggable.index }}
{% endif %}
{% if loggable._TCP_ROUTING is defined %}
_TCP_ROUTING = {{ loggable._TCP_ROUTING }}
{% endif %}
{% endfor %}
[tcpout]
defaultGroup = default_output_server
# {{ ansible_managed }}
[tcpout:default_output_server]
server = {{SPLUNKFORWARDER_SERVER}}
{% for server in SPLUNKFORWARDER_SERVERS|selectattr("default", "defined") %}
[tcpout]
defaultGroup = {{ server.target_group }}
[tcpout-server://{{ server.server }}]
{% endfor %}
[tcpout-server://{{SPLUNKFORWARDER_SERVER}}]
# forwarder receivers
{% for server in SPLUNKFORWARDER_SERVERS %}
[tcpout: {{ server.target_group }}]
server = {{ server.server }}
{% endfor %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment