mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-13 04:32:48 +01:00
add node's own ip to FILEBEAT_EXTRA_HOSTS
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
{% set MANAGER = salt['grains.get']('master') %}
|
||||
{% from 'filebeat/map.jinja' import THIRDPARTY with context %}
|
||||
{% from 'filebeat/map.jinja' import SO with context %}
|
||||
{% from 'filebeat/map.jinja' import LOGSTASH_NODES with context %}
|
||||
{% from 'filebeat/map.jinja' import FILEBEAT_EXTRA_HOSTS with context %}
|
||||
{% set ES_INCLUDED_NODES = ['so-eval', 'so-standalone', 'so-managersearch', 'so-node', 'so-heavynode', 'so-import'] %}
|
||||
|
||||
include:
|
||||
@@ -109,7 +109,7 @@ so-filebeat:
|
||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-filebeat:{{ VERSION }}
|
||||
- hostname: so-filebeat
|
||||
- user: root
|
||||
- extra_hosts: {{ LOGSTASH_NODES }}
|
||||
- extra_hosts: {{ FILEBEAT_EXTRA_HOSTS }}
|
||||
- binds:
|
||||
- /nsm:/nsm:ro
|
||||
- /opt/so/log/filebeat:/usr/share/filebeat/logs:rw
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{#% set SO = salt['pillar.get']('filebeat:third_party_filebeat', default=SODEFAULTS.third_party_filebeat, merge=True) %#}
|
||||
|
||||
{% set role = grains.role %}
|
||||
{% set LOGSTASH_NODES = [] %}
|
||||
{% set FILEBEAT_EXTRA_HOSTS = [] %}
|
||||
{% set mainint = salt['pillar.get']('host:mainint') %}
|
||||
{% set localhostip = salt['grains.get']('ip_interfaces').get(mainint)[0] %}
|
||||
{% if role in ['so-sensor', 'so-fleet', 'so-node' ] %}
|
||||
@@ -14,10 +14,10 @@
|
||||
{% for node_type, node_details in node_data.items() | sort %}
|
||||
{% if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] %}
|
||||
{% for hostname in node_data[node_type].keys() %}
|
||||
{% do LOGSTASH_NODES.append({hostname:node_details[hostname].ip}) %}
|
||||
{% do FILEBEAT_EXTRA_HOSTS.append({hostname:node_details[hostname].ip}) %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% do LOGSTASH_NODES.append({grains.host:localhostip}) %}
|
||||
{% endif %}
|
||||
|
||||
{% do FILEBEAT_EXTRA_HOSTS.append({grains.host:localhostip}) %}
|
||||
|
||||
Reference in New Issue
Block a user