How to use "]" in a regsub converter inside a log format

FYI I posted a workaround via LUA, which also works for log formats here: