natethegreat_23
Jul 25, 2017Nimbostratus
iRule OR statement in URI
In my working iRule for the ASM, I am looking for a specific URI with the statement:
if { [HTTP::uri] starts_with "/abc/zyx/type1/text" }
{ "do action"
}
Now I would like to do the same action for URIs that are exactly the same besides directory type1 now has type1-7. I think that the following code should work:
if { [[HTTP::uri] starts_with "/abc/zyx/type1/text"] || [[HTTP::uri] starts_with "/abc/zyx/type2/text"] || [[HTTP::uri] starts_with "/abc/zyx/type3/text"] || ......... }
{ "do action"
}
But that gets out of hand with 7 different types and needed ORs. Is there a way to make a simpler code with somehow only needing to type the full URI once? Something that looks like:
if { [HTTP::uri] starts_with "/abc/zyx/[type1-7]/text" }
{ "do action"
}
Or am I stuck with copying the whole URI out 7 times? Thank you!