Files
dsk-iac/ansible/01_old/roles/dsk_bot.datasaker/templates/log-agent-config.yml.j2
2023-12-19 13:36:16 +09:00

42 lines
1.3 KiB
Django/Jinja

agent:
metadata:
agent_name: {{ metadata.agent_name | default('dsk-log-agent') }}
cluster_id: {{ metadata.cluster_id | default('unknown') }}
logs:
{% for log in logs | default([{'service': 'default', 'collect': {'type': 'file', 'category': 'etc', 'file': {'paths': ['/var/log/*.log']}}}]) %}
- service: {{ log.service | default('default') }}
tag:
{% for tag in log.tag | default([]) %}
- {{ tag }}
{% endfor %}
keyword:
{% for keyword in log.keyword | default([]) %}
- {{ keyword }}
{% endfor %}
multiline:
format: {{ log.multiline.format | default('') }}
pattern:
{% for pattern in log.multiline.pattern | default([]) %}
- {{ pattern }}
{% endfor %}
masking:
{% for mask in log.masking | default([]) %}
- pattern: {{ mask.pattern }}
replace: {{ mask.replace }}
{% endfor %}
collect:
{% if log.collect.type == "file" %}
type: {{ log.collect.type | default('file') }}
category: {{ log.collect.category | default('etc') }}
address: {{ log.collect.address | default('') }}
file:
paths:
{% for path in log.collect.file.paths %}
- {{ path }}
{% endfor %}
exclude_paths:
{% for exclude_path in log.collect.file.exclude_paths | default([]) %}
- {{ exclude_path }}
{% endfor %}
{% endif %}
{% endfor %}