Фильтрация журналов данных в локальном агенте перед отправкой - PullRequest
0 голосов
/ 13 марта 2019

Я использую datadog agent 6.9, который запускается на моем хосте (не на докере), и я также запускаю несколько приложений на своем хосте (образы докеров).

Я пытаюсь избежать отправки определенных журналов в datadoghqиз моего mongodb.Таким образом, в соответствии с https://docs.datadoghq.com/logs/log_collection/?tab=tailexistingfiles я создаю каталог mongo.d и conf.yaml внутри, который выглядит следующим образом:

init_config:
instances:
  # Specify the MongoDB URI, with database to use for reporting (defaults to "admin")
  # E.g. mongodb://datadog:LnCbkX4uhpuLHSUrcayEoAZA@localhost:27016/my-db
  - server: mongodb://datadog:LnCbkX4uhpuLHSUrcayEoAZA@localhost:27016/my-db
    # Controls connectTimeoutMS, serverSelectionTimeoutMS and socketTimeoutMS (see http://api.mongodb.com/python/3.4.0/api/pymongo/mongo_client.html)
    # Defaults to 30 seconds
    # timeout: 30

    # tags:
    #   - optional_tag1
    #   - optional_tag2

    # Whether or not to read from available replicas (default true).
    # Disable this if any replicas are inaccessible to the agent.
    replica_check: true

    # Optional SSL parameters, see https://github.com/mongodb/mongo-python-driver/blob/2.6.3/pymongo/mongo_client.py#L193-L212
    # for more details
    #
    # ssl: True # Optional (default to False)
    # ssl_keyfile: # Path to the private keyfile used to identify the local
    # ssl_certfile: # Path to the certificate file used to identify the local connection against mongod.
    # ssl_cert_reqs: 0 # Specifies whether a certificate is required from the other side of the connection, and whether it will be validated if provided.
    # Possible values:
    #   * 0 for ssl.CERT_NONE (certificates ignored)
    #   * 1 for ssl.CERT_OPTIONAL (not required, but validated if provided)
    #   * 2 for ssl.CERT_REQUIRED (required and validated)
    # ssl_ca_certs: #  Path to the ca_certs file
    #
    # By default, the check collects a sample of metrics from MongoDB.
    # The (optional) `additional_metrics` parameter instructs the check to collect additional
    # metrics on specific topics.
    # Available options are:
    # * `metrics.commands` - Use of database commands
    # * `tcmalloc` -  TCMalloc memory allocator
    # * `top` - Usage statistics for each collection
    # * `collection` - Metrics of the specified collections
    additional_metrics:
      - metrics.commands
      - tcmalloc
      - top
      - collection
    #
    # Collect metrics on specific collections from the database specified
    # Requires `additional_metrics.collection` to be present
    # Metrics such as `mongodb.collection.count` will be collected for each named collection and tagged as follows:
    #   - `db:<dbname>` e.g. `db:my-db`
    #   - `collection:<collection-name>` e.g. `collection:my_collection`
    # Each collection generates many metrics,
    # up to 8 + the number of indices on the collection for each collection
    collections:
  - apples
  - oranges
# Collect indexes access metrics for every index in every collections in
# the 'collections' list. This is available starting mongo 3.2.
# collections_indexes_stats: false

## Log section (Available for Agent >=6.0)

logs:

    # - type : (mandatory) type of log input source (tcp / udp / file)
    #   port / path : (mandatory) Set port if type is tcp or udp. Set path if type is file
    #   service : (mandatory) name of the service owning the log
    #   source : (mandatory) attribute that defines which integration is sending the logs
    #   sourcecategory : (optional) Multiple value attribute. Can be used to refine the source attribtue
    #   tags: (optional) add tags to each logs collected

    # - type: file
    #   path: /var/log/mongodb/mongodb.log
    #   service: mongo
    #   source: mongodb
    - type: docker
      service: mongo
      source: mongodb
      log_processing_rules:
      - type: exclude_at_match
        name: exclude_mongo
        pattern: (?s).*

Но когда я перезагружаю свой агент, он все еще отправляет нежелательные журналы в мой datadoghq.

Заранее спасибо за помощь, Барух

...