Forum Discussion
cpt_ri_F5
Cirrostratus
Jun 19, 2024LTM - iRule operator
Hello,
We agree that I can simplify the line :
(not [HTTP::header "str1"] equals "str2"))
to
[HTTP::header "str1"] ne "str2")
I have a doubt : https://clouddocs.f5.com/api/irules/Operators.html
Thank you.
LTM - 15.x
3 Replies
Hi cpt_ri_F5,
You can use "ne" operator for string comparisons. The function of the following two lines is the same.
not ([HTTP::header str1] equals "str2") [HTTP::header str1] ne "str2"eq ne: Boolean string equal and string not equal. Each operator produces a zero/one result. The operand types are interpreted only as strings
it is better to use gui based local traffic policy to avoid scripting typo
- cpt_ri_F5
Cirrostratus
Hello, Thank you for your feedback,
Enes_Afsin_Al, why did you remove the quotes from str1?
zamroni777, the iRule editor also validates the syntax.
Thank you