while probably not the most ideal solution... i found a quick method to do this using the builtin converters within the configuration to append the padding where necessary.
here is an example: log-format %[var(txn.jwtpayload),b64dec] http-request set-var(txn.jwtpayload) req.hdr('x-jwtpayload') http-request set-var(txn.jwtpayload) str(),concat(,txn.jwtpayload,==) if !{ var(txn.jwtpayload),length,mod(4) -m int eq 0 } { var(txn.jwtpayload),length,mod(2) -m int eq 0 } http-request set-var(txn.jwtpayload) str(),concat(,txn.jwtpayload,=) if !{ var(txn.jwtpayload),length,mod(4) -m int eq 0 }