Created
June 3, 2025 11:45
-
-
Save maartenberg/1689897d0be50ea68dc4529089c83df4 to your computer and use it in GitHub Desktop.
Caddy log filter repro
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
| http://localhost:8081 { | |
| log { | |
| format filter { | |
| request>uri regexp `foo` `BAR` | |
| request>uri regexp `baz` `QUUX` | |
| } | |
| } | |
| respond "OK" 200 | |
| } |
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
| { | |
| "logging": { | |
| "logs": { | |
| "default": { | |
| "exclude": [ | |
| "http.log.access.log0" | |
| ] | |
| }, | |
| "log0": { | |
| "encoder": { | |
| "fields": { | |
| "request\u003euri": { | |
| "filter": "regexp", | |
| "regexp": "baz", | |
| "value": "QUUX" | |
| } | |
| }, | |
| "format": "filter" | |
| }, | |
| "include": [ | |
| "http.log.access.log0" | |
| ] | |
| } | |
| } | |
| }, | |
| "apps": { | |
| "http": { | |
| "servers": { | |
| "srv0": { | |
| "listen": [ | |
| ":8081" | |
| ], | |
| "routes": [ | |
| { | |
| "match": [ | |
| { | |
| "host": [ | |
| "localhost" | |
| ] | |
| } | |
| ], | |
| "handle": [ | |
| { | |
| "handler": "subroute", | |
| "routes": [ | |
| { | |
| "handle": [ | |
| { | |
| "body": "OK", | |
| "handler": "static_response", | |
| "status_code": 200 | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ], | |
| "terminal": true | |
| } | |
| ], | |
| "automatic_https": { | |
| "skip": [ | |
| "localhost" | |
| ] | |
| }, | |
| "logs": { | |
| "logger_names": { | |
| "localhost": [ | |
| "log0" | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
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
| { | |
| "logging": { | |
| "logs": { | |
| "default": { | |
| "exclude": [ | |
| "http.log.access.log0" | |
| ] | |
| }, | |
| "log0": { | |
| "encoder": { | |
| "fields": { | |
| "request\u003euri": { | |
| "filter": "regexp", | |
| "regexp": "foo", | |
| "value": "BAR" | |
| }, | |
| "request\u003euri": { | |
| "filter": "regexp", | |
| "regexp": "baz", | |
| "value": "QUUX" | |
| } | |
| }, | |
| "format": "filter" | |
| }, | |
| "include": [ | |
| "http.log.access.log0" | |
| ] | |
| } | |
| } | |
| }, | |
| "apps": { | |
| "http": { | |
| "servers": { | |
| "srv0": { | |
| "listen": [ | |
| ":8081" | |
| ], | |
| "routes": [ | |
| { | |
| "match": [ | |
| { | |
| "host": [ | |
| "localhost" | |
| ] | |
| } | |
| ], | |
| "handle": [ | |
| { | |
| "handler": "subroute", | |
| "routes": [ | |
| { | |
| "handle": [ | |
| { | |
| "body": "OK", | |
| "handler": "static_response", | |
| "status_code": 200 | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| ], | |
| "terminal": true | |
| } | |
| ], | |
| "automatic_https": { | |
| "skip": [ | |
| "localhost" | |
| ] | |
| }, | |
| "logs": { | |
| "logger_names": { | |
| "localhost": [ | |
| "log0" | |
| ] | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment