Skip to content

Crowdsec fails to parse Traefik Logs - WORKAROUND PROVIDED #2247

@rayjaymor85

Description

@rayjaymor85

Describe the Bug

On a fresh install there are two lines missing in the default config/traefik/traefik_config.yml file that will prevent the crowdsec integration from parsing traefik logs properly.

I admit I'm not familiar enough with the codebase to find the template in guithub, but I was able to fix my crowdsec implementation (setup by the self-installer tool) by adding these two lines to accessLog.fields.names on the above mentioned file:

RouterName: keep
time: keep

So essentially the top of my traefik_config.yml file now looks like this:

accessLog:
 fields:
    defaultMode: drop
    names:
      RouterName: keep
      time: keep
      ClientAddr: keep
      ClientHost: keep
      DownstreamContentSize: keep
      DownstreamStatus: keep

after the above changes, crowdsec is now parsing my traefik logs just fine

Environment

  • OS Type & Version: Ubuntu 24.04
  • Pangolin Version: 1.41.1
  • Traefik Version: 3.6
  • Crowdsec 1.7.4

To Reproduce

Simply perform a fresh guided installer using the automated installer including the steps to install crowdsec.
Out of the box, traefik logs don't seem to be parsing when checking against `docker exec crowdsec cscli metrics'

Performing the above mentioned changes to config/traefik/traefik_config.yml then restarting the docker stack resolves the issue.

Expected Behavior

docker exec crowdsec cscli metrics should show traefik logs being parsed, with only a small percentage remaining unparsed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions