LTM - 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 : Operators

Thank you.

LTM - 15.x

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

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