From 6e2cf0d63ee3d2c5cfb695f0dc61501503f213a5 Mon Sep 17 00:00:00 2001 From: this-is-tobi Date: Sat, 22 Jul 2023 15:09:32 +0200 Subject: [PATCH] ci: :construction_worker: move filebeat config for helm --- docker-compose-prod.yml | 2 +- .../helm/configs}/filebeat.elastic.yml | 0 infra/kube/helm/templates/configmap.yaml | 141 +----------------- 3 files changed, 2 insertions(+), 141 deletions(-) rename infra/{ => kube/helm/configs}/filebeat.elastic.yml (100%) diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml index 2cb1cfc9..c2948bb3 100644 --- a/docker-compose-prod.yml +++ b/docker-compose-prod.yml @@ -38,6 +38,6 @@ services: - X_OVH_TOKEN - API_OVH_TOKEN volumes: - - $PWD/infra/filebeat.elastic.yml:/usr/share/filebeat/filebeat.yml:ro + - $PWD/infra/kube/helm/configs/filebeat.elastic.yml:/usr/share/filebeat/filebeat.yml:ro - /var/log/basegun:/var/log/basegun command: bash -c "sleep 30 && filebeat -e --strict.perms=false" \ No newline at end of file diff --git a/infra/filebeat.elastic.yml b/infra/kube/helm/configs/filebeat.elastic.yml similarity index 100% rename from infra/filebeat.elastic.yml rename to infra/kube/helm/configs/filebeat.elastic.yml diff --git a/infra/kube/helm/templates/configmap.yaml b/infra/kube/helm/templates/configmap.yaml index 39a4a55a..56e32f8f 100644 --- a/infra/kube/helm/templates/configmap.yaml +++ b/infra/kube/helm/templates/configmap.yaml @@ -13,143 +13,4 @@ metadata: name: {{ include "basegun.name" . }}-filebeat-config data: filebeat.elastic.yml: |- - ###################### Filebeat Configuration Example ######################### - - # This file is an example configuration file highlighting only the most common - # options. The filebeat.reference.yml file from the same directory contains all the - # supported options with more comments. You can use it as a reference. - # - # You can find the full configuration reference here: - # https://www.elastic.co/guide/en/beats/filebeat/index.html - - # For more available modules and options, please see the filebeat.reference.yml sample - # configuration file. - - #=========================== Filebeat inputs ============================= - - filebeat.inputs: - - # Each - is an input. Most options can be set at the input level, so - # you can use different inputs for various configurations. - # Below are the input specific configurations. - - - type: log - - # Change to true to enable this input configuration. - enabled: true - - # Paths that should be crawled and fetched. Glob based paths. - paths: - - /tmp/log/basegun/log.json - - # Exclude lines. A list of regular expressions to match. It drops the lines that are - # matching any regular expression from the list. - #exclude_lines: ['^DBG'] - - # Include lines. A list of regular expressions to match. It exports the lines that are - # matching any regular expression from the list. - #include_lines: ['^ERR', '^WARN'] - - # Exclude files. A list of regular expressions to match. Filebeat drops the files that - # are matching any regular expression from the list. By default, no files are dropped. - #exclude_files: ['.gz$'] - - # Optional additional fields. These fields can be freely picked - # to add additional information to the crawled log files for filtering - #fields: - # level: debug - # review: 1 - - ### JSON configuration - - # Decode JSON options. Enable this if your logs are structured in JSON. - # JSON key on which to apply the line filtering and multiline settings. This key - # must be top level and its value must be string, otherwise it is ignored. If - # no text key is defined, the line filtering and multiline features cannot be used. - #json.message_key: - - # By default, the decoded JSON is placed under a "json" key in the output document. - # If you enable this setting, the keys are copied top level in the output document. - json.keys_under_root: true - - # If keys_under_root and this setting are enabled, then the values from the decoded - # JSON object overwrite the fields that Filebeat normally adds (type, source, offset, etc.) - # in case of conflicts. - json.overwrite_keys: false - - # If this setting is enabled, Filebeat adds a "json_error" key in case of JSON - # unmarshaling errors or when a text key is defined in the configuration but cannot - # be used. - json.add_error_key: true - - json.expand_keys: true - - #============================= Filebeat modules =============================== - - filebeat.config.modules: - # Glob pattern for configuration loading - path: ${path.config}/modules.d/*.yml - - # Set to true to enable config reloading - reload.enabled: false - - # Period on which files under path should be checked for changes - #reload.period: 10s - - #================================ General ===================================== - - # The name of the shipper that publishes the network data. It can be used to group - # all the transactions sent by a single shipper in the web interface. - #name: - - # The tags of the shipper are included in their own field with each - # transaction published. - #tags: ["service-X", "web-tier"] - - # Optional fields that you can specify to add additional information to the - # output. - fields_under_root: true - fields: - X-OVH-TOKEN: "${X_OVH_TOKEN}" - - #================================ Outputs ===================================== - - # Configure what output to use when sending the data collected by the beat. - - #================================ Processors ===================================== - - # Configure processors to enhance or manipulate events generated by the beat. - - processors: - - add_host_metadata: ~ - - add_cloud_metadata: ~ - - #==================== Elasticsearch template setting ========================== - - setup.template.enabled: false - setup.ilm.enabled: false - - #-------------------------- Elasticsearch output ------------------------------ - output.elasticsearch: - # Array of hosts to connect to. - hosts: ["gra1.logs.ovh.com:9200"] - - # Protocol - either `http` (default) or `https`. - protocol: "https" - - # Authentication credentials using API key - username: "${API_OVH_TOKEN}" - password: "token" - index: "ldp-logs" - - #================================ Logging ===================================== - - # Sets log level. The default log level is info. - # Available log levels are: error, warning, info, debug - #logging.level: debug - - # At debug level, you can selectively enable logging only for some components. - # To enable all selectors use ["*"]. Examples of other selectors are "beat", - # "publish", "service". - #logging.selectors: ["*"] - + {{ .Files.Get "configs/filebeat.elastic.yml" | nindent 4 }} \ No newline at end of file