Last active
January 18, 2025 09:47
-
-
Save acouvreur/e1be47013c182fc85f03351210ae13d7 to your computer and use it in GitHub Desktop.
Traefik accessLog regex with groups - CLF (Common Log Format) parsing for log collection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Regex flavors: PCRE | |
^(?<client>\S+) \S+ (?<userid>\S+) \[(?<datetime>[^\]]+)\] "(?<method>[A-Z]+) (?<request>[^ "]+)? HTTP\/[0-9.]+" (?<status>[0-9]{3}) (?<size>[0-9]+|-) "(?<referrer>\S+)" "(?<user_agent>\S+)" (?<requestsTotal>)\d+ "(?<router>\S+)" "(?<server_URL>\S+)" (?<request_duration>\d+)ms | |
## Regex flavors: .NET, Java 7, XRegExp, PCRE 7, Perl 5.10, Ruby 1.9 | |
^(?P<client>\S+) \S+ (?P<userid>\S+) \[(?P<datetime>[^\]]+)\] "(?P<method>[A-Z]+) (?P<request>[^ "]+)? HTTP\/[0-9.]+" (?P<status>[0-9]{3}) (?P<size>[0-9]+|-) "(?P<referrer>\S+)" "(?P<user_agent>\S+)" (?P<requestsTotal>)\d+ "(?P<router>\S+)" "(?P<server_URL>\S+)" (?P<request_duration>\d+)ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment