[Filebeat] template 설정 setup.template.append_fields
Elastic/Beats 2020. 6. 3. 14:15참고 문서)
https://www.elastic.co/guide/en/beats/filebeat/current/configuration-template.html
설정 중에 필요한 내용이 있어서 기록해 봅니다.
setup.template.append_fields
A list of fields to be added to the template and Kibana index pattern.
This setting adds new fields. It does not overwrite or change existing fields.
This setting is useful when your data contains fields that Filebeat doesn’t know about in advance.
If append_fields is specified along with overwrite: true,
Filebeat overwrites the existing template and applies the new template when creating new indices.
Existing indices are not affected.
If you’re running multiple instances of Filebeat with different append_fields settings,
the last one writing the template takes precedence.
Any changes to this setting also affect the Kibana index pattern.
Example config:
setup.template.overwrite: true
setup.template.append_fields:
- name: test.name
type: keyword
- name: test.hostname
type: long
이 설정으로 dynamic mapping 이나 template 관련 번거로움을 간단하게 해결 할 수 있습니다.
저는 몇 개 field 에 대해서 date 로 설정을 해야 해서 이 설정을 사용했습니다.