it seems you want to replace the header value with something else? What do you want to accomplish exactly?
You can try this.
if { [HTTP::header exists x-id] } {
set VALUE [HTTP::header “XXX#YYYY”] log command to determine if VALUE is set correctly
log local0. “x-idlog var VALUE=$VALUE”
# header x-d allready exists → remove it first.
HTTP::header remove x-id
# add header x-id with variable VALUE
HTTP::header insert x-id $VALUE
}
The problem might be the var VALUE is not set correctly, and is thus empty.
i would troubleshoot ‘bottom-up’ and use lowercase for variables (not sure if that has an impact, but it is a good practice).
i don’t know what XXX#YYYY is, but it needs to exists as a header, or whatever you use instead of XXX#YYYY. so lets see if it exists first in the logs.
when HTTP_REQUEST { foreach header_name [HTTP::header names] { log local0. “$header_name” }
if { [HTTP::header exists x-id] } {
set value [HTTP::header “XXX#YYYY”] log command to determine if VALUE is set correctly
log local0. “x-idlog var value=${value}”
# header x-id allready exists → remove it first.
HTTP::header remove x-id
# add header x-id with variable value
HTTP::header insert x-id $value
}
}
check system > logs > local traffic for errors and logs.
just short tell you what I have, I have form the application the header x-id with no value inside (empty), so my WAF policy don’t like that and block the request, what I now want to do is just to set a value inside the header x-id. Thanks for your response