Skip to content

Support h2c backend URL scheme in traefik-logs (#1966) - #1975

Merged
sabban merged 1 commit into
crowdsecurity:masterfrom
rafaelsoje:traefik-h2c-backend-url
Nov 25, 2026
Merged

sabban merged 1 commit into
crowdsecurity:masterfrom
rafaelsoje:traefik-h2c-backend-url

Conversation

@rafaelsoje

Copy link
Copy Markdown
Contributor

Description

This PR updates TRAEFIK_SERVER_URL in crowdsecurity/traefik-logs to support backend URLs using schemes with digits such as h2c:// (cleartext HTTP/2), closing #1966.

Root Cause & Details

  • Grok's built-in %{URI} relies on %{URIPROTO} ([A-Za-z]+(\+[A-Za-z+]+)?), which only matches alphabetic characters and rejects valid RFC 3986 URI schemes containing digits such as h2c.
  • Updated TRAEFIK_SERVER_URL in parsers/s01-parse/crowdsecurity/traefik-logs.yaml to ([A-Za-z][A-Za-z0-9+.-]*://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})?|\-).
  • Added the h2c:// CLF access log sample and regenerated full assertions in .tests/traefik_clf/ (890/890 assertions passing via cscli hubtest run traefik_clf).

Closes #1966

Checklist

  • I have read the contributing guide
  • I have tested my changes locally
  • For new parsers or scenarios, tests have been added
  • I have run the hub linter and no issues were reported (see contributing guide)
  • Automated tests are passing
  • AI was used to generate any/all content of this PR

@sabban

sabban commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Hi, thank you for your contribution!

Please rebase on master (conflicts with #1978) and regenerate parser.assert.

@sabban sabban added the waiting-for-user Waiting for submitter answer regarding specific points in the PR label Nov 13, 2026
@rafaelsoje
rafaelsoje force-pushed the traefik-h2c-backend-url branch from 13113c1 to 1ad6bb1 Compare November 13, 2026 11:46
@rafaelsoje

Copy link
Copy Markdown
Contributor Author

Rebased on master and updated parser.assert. Ready for review.

@sabban
sabban merged commit 19c1b0b into crowdsecurity:master Nov 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-for-user Waiting for submitter answer regarding specific points in the PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traefik parser fails to parse access log entries when backend URL uses h2c://

2 participants