Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[FEATURE][v2]: Provide a new "allow_list" to the log filter #3562
Labels
Milestone
Comments
|
See the ip_mask filter, you can specify options on a filter. I think what we want is an "except" option on the delete filter. That way we don't need to worry about ordering of the filters. |
|
Would that work if I delete the If yes, definitely simpler and way better ;) |
|
Also, except should be an array |
|
Yeah that's what I'm thinking. An "except" option that takes an array of fields to keep after deleting, and those fields must be subfields of the one being deleted, I guess. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


I'm in a current dilemma regarding my logs in Caddy v2.1.1...
I'm planning to have structured logs using the
jsonencoder. I tried it but the chances of having sensitive info leaking in the logs is pretty high because a lot of our apps use multiple headers likeAuthorization:X-Auth-Token:, etc and due to compliance concerns, I can't (and don't want to) be managing what headers I delete via thedeletelog filter.That being said, it would be nice to have some kind of log filter in place to allow only a predefined list of headers to be logged.
Example: The only header I care of at the moment is the
User-Agent. So, having something like the log config below would be super nice to filter anything else but theUser-Agentin therequest.headersjson block{"logging": { "logs": { "log0": { "encoder": { "format": "filter", "wrap": "json", "fields": { "request>headers": { "filter": "delete" }, "request>headers>User-Agent": { "filter": "<the_name_of_the_new_filter>" } } } } } }