Aleks,

On 4/8/21 5:07 PM, Aleksandar Lazic wrote:
http-request set-var(sess.json) %[req.hdr(Authorization),b64dec,json_string("\$.kubernetes\\.io/serviceaccount/namespace")]

http-request set-var() does not expect the %[] syntax, because it always takes a sample. Even the following returns the same error message:

http-request set-var(sess.json) %[req.hdr(Authorization)]

I expect that the decoded json string is in args[0] and the "\$.kubernetes\\.io/serviceaccount/namespace" is in smp, is this assumption right?

The assumption is not correct, because you are not searching for a fetch. You want a converter, because you are converting an existing sample. I suggest you take a look at the "digest" converter. You can find it in sample.c.

Best regards
Tim Düsterhus

Reply via email to