fix: kubernetes configuration

This commit is contained in:
RouxAntoine 2022-04-28 14:22:43 +02:00
parent f1f597f0df
commit 1f9bd80ffe
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
2 changed files with 20 additions and 21 deletions

View File

@ -1,7 +1,7 @@
filebeat.config: #filebeat.config:
modules: # modules:
path: ${path.config}/modules.d/*.yml # path: ${path.config}/modules.d/*.yml
reload.enabled: false # reload.enabled: false
filebeat.autodiscover: filebeat.autodiscover:
providers: providers:

View File

@ -1,35 +1,34 @@
filebeat.config: #filebeat.config:
modules: # modules:
path: ${path.config}/modules.d/*.yml # path: ${path.config}/modules.d/*.yml
reload.enabled: false # reload.enabled: false
filebeat.autodiscover: filebeat.autodiscover:
providers: providers:
- type: kubernetes - type: kubernetes
node: '${NODE_NAME}' node: '${NODE_NAME}'
hints.enabled: true hints.enabled: true
#templates:
# - config:
# - type: container
# paths:
# - /var/log/containers/*-${data.kubernetes.container.id}.log
# kubernetes pod annotation example # kubernetes pod annotation example
# annotations: # annotations:
# co.elastic.logs.json-logging/json.keys_under_root: "true" # co.elastic.logs.json-logging/json.keys_under_root: "true"
# co.elastic.logs.json-logging/json.add_error_key: "true" # co.elastic.logs.json-logging/json.add_error_key: "true"
# co.elastic.logs.json-logging/json.message_key: "message" # co.elastic.logs.json-logging/json.message_key: "message"
#
hints.default_config: hints.default_config:
type: container type: container
paths: paths:
- /var/log/containers/*${data.kubernetes.container.id}.log - /var/log/containers/*-${data.kubernetes.container.id}.log
processors: processors:
- add_cloud_metadata: ~ - add_cloud_metadata: ~
- add_locale: - add_locale:
format: offset format: offset
- add_docker_metadata: - add_kubernetes_metadata:
host: "unix:///var/run/docker.sock"
- add_host_metadata: ~ - add_host_metadata: ~
- decode_json_fields:
fields: ["message"]
target: "json"
overwrite_keys: true
setup: setup:
kibana: kibana:
@ -51,7 +50,7 @@ output.elasticsearch:
ssl: ssl:
verification_mode: none verification_mode: none
indices: indices:
- index: "filebeat-%{[agent.version]}-%{[container.name]:common}-%{+yyyy.MM.dd}" - index: "filebeat-%{[agent.version]}-%{[kubernetes.container.name]:common}-%{+yyyy.MM.dd}"
#logging.json: true #logging.json: true