complex irules
1 Topicirule syntax error
Hi Folks, I'm new to iRules and need to create few irules which is provided by the application vendor and getting an error for one of the line as shown below in italic bold letter. The syntax starts with "for=" and LTM is giving below error. 01070151:3: Rule [/Common/iRule_Single_VIP] error: /Common/iRule_Single_VIP:58: error: [undefined procedure: for=]["for="[IP::client_addr]";] /Common/iRule_Single_VIP:58: error: [undefined procedure: TCP::local_host][TCP::local_host] if { not [HTTP::header exists "x-forwarded-for" ] } { HTTP::header insert "X-Forwarded-For" [getfield [IP::client_addr] "%" 1] } ### HTTP::header replace "X-Forwarded-For" [getfield [IP::client_addr] "%" 1] HTTP::header replace "Host" [HTTP::host] HTTP::header insert "X-Forwarded-Host" [HTTP::host] HTTP::header insert "X-Forwarded-Hostname" [getfield [HTTP::host] ":" 1] ## Check to see that an upstream proxy has not already inserted ## the X-Forwarded-Port header, if not insert with current local ## port being used if { not [HTTP::header exists "x-forwarded-port" ] } { HTTP::header insert "X-Forwarded-Port" [TCP::local_port] } HTTP::header insert "X-Forwarded-ContextPath" /$dsServiceName HTTP::header insert "X-Forwarded-Proto" "https" # Create the Forward header to be compliant with RFC7239 # set string "for="[IP::client_addr]";proto="$proto";by="[TCP::local_host]";host="[HTTP::host]";contextpath="$dsServiceName # HTTP::header insert "Forwarded" string ## For each response which was a CORS request add the CORS ## headers to allow potential in page content to access ## information from this service ## ## F5 will be creating for the client. This allows the ## application to have the information even on the initial ## request ## } Can someone guide please?749Views0likes4Comments