Forum Discussion
TCL error
Hello , We are getting below error in logs on our F5 loadbalancer , was trying to understand what it is related to . If anyone can help .
TCL error: iR_XFF_RewriteOrInsert - Operation not supported (line 4) invoked from within "HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"]
10 Replies
- A code sample would be useful.
- Joey_B_134415
Nimbostratus
Can you include some or all of the code for iR_XFF_RewriteOrInsert? Of particular interest is line 4....
- amit_128525
Nimbostratus
thanks for reply was just trying to find where I need to see line4 as I am using GUI , do I need to check it on command line
- Kevin_Stewart
Employee
I believe Joey and Josh are asking you to post the complete iRule, which would be most helpful for troubleshooting.
- amit_128525
Nimbostratus
hello below is the irule .
when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] } }
- nathe
Cirrocumulus
amit, might this be a simple formatting issue?
This appears ok on my test system:
when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] } }See if that helps,
N
- amit_128525
Nimbostratus
thanks for reply Nathan , but irule seems to be fine with format which i have used not sure why we are still getting this alert
- amit_128525
Nimbostratus
by line 4 it means below one right " } else { "
- nathe
Cirrocumulus
Amit,
According to the wiki on HTTP::header:
This command performs a header insertion if the header was not present.So do we need the HTTP::insert line after all?
Could it just be:
when HTTP_REQUEST { HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] }But to answer your question it's not the else statement but the insert command it looks like it doesn't like. What happens it you change the line to be:
HTTP::header insert X-Forwarded-For [IP::client_addr]Does this work and then point to the substr being the issue?
Just a thought.
N
- amit_128525
Nimbostratus
Thanks for detailed reply , one thing we never had these logs earlier , we have started getting these logs when we placed another irule with the existing irule under the VS existing irule when HTTP_REQUEST { if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For [substr [IP::client_addr] 0 "%"] } else { HTTP::header insert X-Forwarded-For [substr [IP::client_addr] 0 "%"] } }
new irule added last week to function with existing irule when HTTP_REQUEST { if {([class match [IP::remote_addr] equals whitelist]) } { pool Pool_1 } else { HTTP::respond 503 content [b64decode [class element -name 0 DG_MAINTENANCE_HTML]] "Content-Type" "text/html" } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com