From 608ba31e034fb0c291bf087fc6a7fb10a55866da Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 1 Sep 2022 09:54:29 +0300 Subject: [PATCH] fix config file Signed-off-by: ChrsMark --- elastic-agent.yml | 114 +++++++++++++--------------------------------- 1 file changed, 32 insertions(+), 82 deletions(-) diff --git a/elastic-agent.yml b/elastic-agent.yml index 420c2b16600..4766d426a9c 100644 --- a/elastic-agent.yml +++ b/elastic-agent.yml @@ -15,72 +15,23 @@ outputs: # username: "elastic" # password: "changeme" -providers: - local_dynamic: - items: - - vars: - key: value1 - proc: - - add_fields: - fields: - custom: match424242 - target: dynamic - - add_fields: - fields: - hints: true - target: kubernetes - inputs: - - type: logfile - enabled: true - streams: - - paths: - - /var/log/${local_dynamic.key} - processors: - ${local_dynamic.proc} -# processors: -# - ${local_dynamic.proc|'~'} - + - type: system/metrics -#providers: -# kubernetes: -# kube_config: /Users/chrismark/.kube/config -# node: "kind-control-plane" -# hints.enabled: true -# -#inputs: -# - name: templates.d/redis/0.3.6 -# type: redis/metrics -# data_stream.namespace: default -# use_output: default -# streams: -# - data_stream: -# dataset: redis.info -# type: metrics -# metricsets: -# - info -# hosts: -# - "${kubernetes.hints.redis.info.host|kubernetes.hints.redis.host|'127.0.0.1:6379'}" -# idle_timeout: 20s -# maxconn: 10 -# network: tcp -# period: "${kubernetes.hints.redis.info.period|kubernetes.hints.redis.period|'10s'}" -# condition: ${kubernetes.hints.redis.info.enabled} == true or ${kubernetes.hints.redis.enabled} == true -# - data_stream: -# dataset: redis.key -# type: metrics -# metricsets: -# - key -# hosts: -# - "${kubernetes.hints.redis.key.host|kubernetes.hints.redis.host|'127.0.0.1'}:${kubernetes.hints.redis.info.port|'6379'}" -# idle_timeout: 20s -# key.patterns: -# - limit: 20 -# pattern: '*' -# maxconn: 10 -# network: tcp -# period: "${kubernetes.hints.redis.key.period|kubernetes.hints.redis.period|'10s'}" -# condition: ${kubernetes.hints.redis.key.enabled} == true and ${kubernetes.hints.redis.enabled} == true + # Namespace name must conform to the naming conventions for Elasticsearch indices, cannot contain dashes (-), and cannot exceed 100 bytes + # For index naming restrictions, see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html#indices-create-api-path-params + data_stream.namespace: default + use_output: default + streams: + - metricset: cpu + # Dataset name must conform to the naming conventions for Elasticsearch indices, cannot contain dashes (-), and cannot exceed 100 bytes + data_stream.dataset: system.cpu + - metricset: memory + data_stream.dataset: system.memory + - metricset: network + data_stream.dataset: system.network + - metricset: filesystem + data_stream.dataset: system.filesystem # agent.monitoring: # # enabled turns on monitoring of running processes @@ -205,26 +156,26 @@ inputs: # Send all logging output to stderr. The default is false. agent.logging.to_stderr: true -# Send all logging output to syslog. The default is false. -#agent.logging.to_syslog: false + # Send all logging output to syslog. The default is false. + #agent.logging.to_syslog: false -# Send all logging output to Windows Event Logs. The default is false. -#agent.logging.to_eventlog: false + # Send all logging output to Windows Event Logs. The default is false. + #agent.logging.to_eventlog: false -# If enabled, Elastic-Agent periodically logs its internal metrics that have changed -# in the last period. For each metric that changed, the delta from the value at -# the beginning of the period is logged. Also, the total values for -# all non-zero internal metrics are logged on shutdown. This setting is also passed -# to beats running under the agent. The default is true. -#agent.logging.metrics.enabled: true + # If enabled, Elastic-Agent periodically logs its internal metrics that have changed + # in the last period. For each metric that changed, the delta from the value at + # the beginning of the period is logged. Also, the total values for + # all non-zero internal metrics are logged on shutdown. This setting is also passed + # to beats running under the agent. The default is true. + #agent.logging.metrics.enabled: true -# The period after which to log the internal metrics. The default is 30s. -#agent.logging.metrics.period: 30s + # The period after which to log the internal metrics. The default is 30s. + #agent.logging.metrics.period: 30s -# Logging to rotating files. Set logging.to_files to false to disable logging to -# files. -#agent.logging.to_files: true -#agent.logging.files: + # Logging to rotating files. Set logging.to_files to false to disable logging to + # files. + #agent.logging.to_files: true + #agent.logging.files: # Configure the path where the logs are written. The default is the logs directory # under the home path (the binary location). #path: /var/log/elastic-agent @@ -252,7 +203,7 @@ agent.logging.to_stderr: true # Rotate existing logs on startup rather than appending to the existing # file. Defaults to true. - # rotateonstartup: true +# rotateonstartup: true # Set to true to log messages in JSON format. #agent.logging.json: false @@ -300,4 +251,3 @@ agent.logging.to_stderr: true # - vars: # my_var: key3 -