修订sublog判断不正确导致索引名称含有none的问题
This commit is contained in:
parent
431fd883d0
commit
2a086b7935
|
@ -62,11 +62,11 @@ setup.kibana:
|
|||
{% if 'output' not in logs[log_type] or logs[log_type]['output'] == 'elastic' %}
|
||||
output.elasticsearch:
|
||||
hosts: {{ logs[log_type]['es_hosts'] }}
|
||||
{% if 'sublog' in logs[log_type] and logs[log_type]['sublog'] -%}
|
||||
index: "{{ logs[log_type]['index_prefix'] }}-{{ instance_name }}-{{ logs[log_type]['sublog'] }}-%{+yyyy.MM.dd}"
|
||||
#[#1002040] 如果sublog字段配置为none则忽略索引名称中的sublog字段
|
||||
{% elif 'sublog' in logs[log_type] and logs[log_type]['sublog'] == 'none' -%}
|
||||
{% if 'sublog' in logs[log_type] and logs[log_type]['sublog'] == 'none' -%}
|
||||
index: "{{ logs[log_type]['index_prefix'] }}-{{ instance_name }}-%{+yyyy.MM.dd}"
|
||||
{% elif 'sublog' in logs[log_type] and logs[log_type]['sublog'] -%}
|
||||
index: "{{ logs[log_type]['index_prefix'] }}-{{ instance_name }}-{{ logs[log_type]['sublog'] }}-%{+yyyy.MM.dd}"
|
||||
{% else -%}
|
||||
index: "{{ logs[log_type]['index_prefix'] }}-{{ instance_name }}-%{[sublog]}-%{+yyyy.MM.dd}"
|
||||
{% endif -%}
|
||||
|
|
Loading…
Reference in New Issue