Add fields to traefik module output

Hello,

I'm trying to add fields to logs parsed by the traefik module but I can't get it to work.
I tried various syntaxes without luck. By my understanding of the documenation, the following should be working... but isn't.
What am I doing wrong ?

# filebeat.yml

filebeat.modules:
  - module: traefik
    access:
      enabled: true
      var.paths: ["/var/log/traefik/*"]
      input:
        processors:
        - add_fields:
          fields:
            type: traefik
        - add_fields:
          when:
            contains:
              message: test-twapi-nginx@docker
          fields:
            environment: test
        - add_fields:
          when:
            contains:
              message: staging-twapi-nginx@docker
          fields:
            environment: staging
        - add_fields:
          when:
            contains:
              message: preprod-twapi-nginx@docker
          fields:
            environment: preprod

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.