mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 17:52:46 +01:00
loadbalance filebeat if across managers and receivers
This commit is contained in:
@@ -321,7 +321,19 @@ output.logstash:
|
||||
enabled: true
|
||||
|
||||
# The Logstash hosts
|
||||
hosts: ["{{ MANAGER }}:5644"]
|
||||
hosts:
|
||||
{%- set LOADBALANCE = ['false'] %}
|
||||
{%- if grains.role not in ['so-heavynode', 'so-import', 'so-helix', 'so-eval'] %}
|
||||
{%- for minionid, ip in salt['mine.get']('G@role:so-standalone or G@role:so-manager or G@role:so-managersearch or G@role:so-receiver', 'network.ip_addrs', tgt_type='compound') | dictsort() %}
|
||||
- "{{ minionid.split('_')[0] }}:5644" #{{ ip[0] }}
|
||||
{%- if loop.index == 2 %}
|
||||
{%- do LOADBALANCE.insert(0, 'true') %}
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
loadbalance: {{ LOADBALANCE[0] }}
|
||||
{%- else %}
|
||||
- "{{ grains.host }}:5644"
|
||||
{%- endif %}
|
||||
|
||||
# Number of workers per Logstash host.
|
||||
worker: {{ FBLSWORKERS }}
|
||||
|
||||
@@ -82,7 +82,7 @@ salt_minion_service_unit_file:
|
||||
mine_functions:
|
||||
file.managed:
|
||||
- name: /etc/salt/minion.d/mine_functions.conf
|
||||
- source: salt://salt/etc/mine_functions.conf
|
||||
- source: salt://salt/etc/minion.d/mine_functions.conf
|
||||
- template: jinja
|
||||
|
||||
# this has to be outside the if statement above since there are <requisite>_in calls to this state
|
||||
|
||||
Reference in New Issue
Block a user