1. Caddy version (caddy version
):
2. How I run Caddy:
v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=
a. System environment:
Arch Linux x86_64 Kernel 5.9.1-arch1-1
b. Command:
$ caddy run -config Caddyfile
d. My complete Caddyfile or JSON config:
:3000 {
log {
output file /tmp/caddy/access.log
format filter {
wrap console
fields {
format ip_mask {
ipv4_cidr "255.255.255.0"
}
}
}
}
root * /tmp
file_server
}
3. The problem I’m having:
Can’t quite work out how to use the ip_mask
log field filter
4. Error messages and/or full log output:
With the config above, I get the following error:
2020/10/20 15:20:02.136 INFO using provided configuration {"config_file": "Caddyfile", "config_adapter": ""}
run: adapting config using caddyfile: parsing caddyfile tokens for 'log': Caddyfile:8 - Error during parsing: unrecognized subdirective ipv4_cidr
5. What I already tried:
Tried bunch of different combinations of the above config but I’m not able to work out how the whole format/wrap/filter/encoder thing is doing it’s work, and not finding any examples on how to use ip_mask in Caddyfile either. Found one JSON version but cannot figure out how that translates into Caddyfile syntax (Upgrading to v2 - #9 by conorlburns)
I’m trying to convert a Caddyfile I have for v1, into v2 format, but not having great luck. What I used to use:
log stdout {
ipmask 255.255.0.0 ffff:ffff:ffff:ff00::
}