Skip to content

Fix IPv6 address parsing in envoy-logs parser#1659

Merged
LaurenceJJones merged 1 commit intocrowdsecurity:masterfrom
LaurenceJJones:fix-envoy-ipv6-parsing
Jan 27, 2026
Merged

Fix IPv6 address parsing in envoy-logs parser#1659
LaurenceJJones merged 1 commit intocrowdsecurity:masterfrom
LaurenceJJones:fix-envoy-ipv6-parsing

Conversation

@LaurenceJJones
Copy link
Copy Markdown
Contributor

Description

  • Use lastIndexOf to extract IP from address:port format instead of split/join
  • Handle IPv6 addresses in brackets correctly for both JSON and CLF formats
  • Simplify expressions to match consistent style
  • Add test cases for IPv6 addresses in both JSON and CLF formats
  • Add test cases for multiple IPs in x-forwarded-for (upstream proxies)

Fixes #1658

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

- Use lastIndexOf to extract IP from address:port format instead of split/join
- Handle IPv6 addresses in brackets correctly for both JSON and CLF formats
- Simplify expressions to match consistent style
- Add test cases for IPv6 addresses in both JSON and CLF formats
- Add test cases for multiple IPs in x-forwarded-for (upstream proxies)

Fixes crowdsecurity#1658
@LaurenceJJones LaurenceJJones marked this pull request as ready for review January 24, 2026 10:38
@LaurenceJJones LaurenceJJones merged commit 4b31dc6 into crowdsecurity:master Jan 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yanis-kouidri/envoy fails to parse IPv6 upstream addresses

1 participant