1. The problem I’m having:
I’d like to minimize log data. I don’t care about most of the request headers, but I do care about the user agent. I can suppress logging all request headers with
format filter {
wrap json
fields {
request>headers delete
That also removes the user agent. I could enumerate every possible header, or some significant portion thereof, and include lines to delete them, like so:
format filter {
wrap json
fields {
request>headers>Accept delete
request>headers>Accept-Encoding delete
request>headers>Accept-Language delete
request>headers>Cache-Control delete
request>headers>Connection delete
request>headers>If-None-Match delete
request>headers>Priority delete
request>headers>Upgrade-Insecure-Requests delete
That’s time consuming, and playing whack-a-mole against a never-ending list.
Is there a way to say “delete all headers EXCEPT FOR these ones I want” ?
3. Caddy version:
v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=
- How I installed and ran Caddy:
a. System environment:
Linux skippy 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux