Forum Discussion

Chadwick_McInni's avatar
Chadwick_McInni
Icon for Nimbostratus rankNimbostratus
Nov 02, 2007

How to escape $

Hi, in the rule below, we need to insert a header with a name that starts with $. Escaping $ with \ (\$) isn't working. Is there another way to escape $ ?

 

 

when HTTP_REQUEST {

 

HTTP::header insert "\$xyz" "ValueOfXYZheader"

 

log local0.info "header is [HTTP::header value \$xyz]"

 

}

 

 

The ltm log shows:

 

Rule insert_header_rule : header is

 

The header value isn't displayed.

 

 

We've tried "\$xyz", {\$}, \$, ...

 

 

Thanks,

 

Chad

2 Replies

  • I think you should be able to use curly braces to force the header name to be interpreted as a string:

     

     

    HTTP::header insert {$xyz} "ValueOfXYZheader"

     

     

    Aaron
  • This worked, changed the $ to its html value, and escaped the & and with \. Thanks!

     

     

    HTTP::header insert "\&\36xyz" "ValueOfXYZheader"