mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 10:12:53 +01:00
29 lines
1.5 KiB
Django/Jinja
29 lines
1.5 KiB
Django/Jinja
{% import_yaml 'elasticsearch/defaults.yaml' as ELASTICSEARCHDEFAULTS %}
|
|
{% set DEFAULT_GLOBAL_OVERRIDES = ELASTICSEARCHDEFAULTS.elasticsearch.index_settings.pop('global_overrides') %}
|
|
|
|
{% set PILLAR_GLOBAL_OVERRIDES = {} %}
|
|
{% if salt['pillar.get']('elasticsearch:index_settings') is defined %}
|
|
{% set ES_INDEX_PILLAR = salt['pillar.get']('elasticsearch:index_settings') %}
|
|
{% if ES_INDEX_PILLAR.global_overrides is defined %}
|
|
{% set PILLAR_GLOBAL_OVERRIDES = ES_INDEX_PILLAR.pop('global_overrides') %}
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% set ES_INDEX_SETTINGS_ORIG = ELASTICSEARCHDEFAULTS.elasticsearch.index_settings %}
|
|
|
|
{% set ES_INDEX_SETTINGS_GLOBAL_OVERRIDES = {} %}
|
|
{% for index in ES_INDEX_SETTINGS_ORIG.keys() %}
|
|
{% do ES_INDEX_SETTINGS_GLOBAL_OVERRIDES.update({index: salt['defaults.merge'](ELASTICSEARCHDEFAULTS.elasticsearch.index_settings[index], PILLAR_GLOBAL_OVERRIDES, in_place=False)}) %}
|
|
{% endfor %}
|
|
|
|
{% set ES_INDEX_SETTINGS = {} %}
|
|
{% do ES_INDEX_SETTINGS_GLOBAL_OVERRIDES.update(salt['defaults.merge'](ES_INDEX_SETTINGS_GLOBAL_OVERRIDES, ES_INDEX_PILLAR, in_place=False)) %}
|
|
{% for index, settings in ES_INDEX_SETTINGS_GLOBAL_OVERRIDES.items() %}
|
|
{% if settings.index_template is defined %}
|
|
{% if not settings.get('index_sorting', False) | to_bool and settings.index_template.template.settings.index.sort is defined %}
|
|
{% do settings.index_template.template.settings.index.pop('sort') %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% do ES_INDEX_SETTINGS.update({index | replace("_x_", "."): ES_INDEX_SETTINGS_GLOBAL_OVERRIDES[index]}) %}
|
|
{% endfor %}
|