Sep 2026 - DevCentral is currently set to Read-Only (Sep 14th) for a platform update.
For some details see: DevCentral is Evolving.

Forum Discussion

ralph_ralf's avatar
ralph_ralf
Icon for Altostratus rankAltostratus
May 17, 2022
Solved

condition irule OR not working

Can somebody help on this. the first irule is working perfectly but when adding OR condition it is not (not working section) .

this is working:

----------------------

when HTTP_REQUEST {
if { (([HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0") and ([IP::client_addr] equals "172.16.37.16"))}
{ reject }}


not working

------------------

when HTTP_REQUEST {
if { (([HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0") or ([HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0?wsdl")
and ([IP::client_addr] equals "172.16.37.16"))}
{ reject }}

  • Hi ralph_ralf,

    You should use "and" instead of "or" to block requests except these two uri.

    when HTTP_REQUEST {
    	if { [IP::client_addr] equals "172.16.37.16" && [HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0" && [HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0?wsdl" } {
    		reject
    	}
    }

2 Replies

Replies have been turned off for this discussion
  • Hi ralph_ralf,

    You should use "and" instead of "or" to block requests except these two uri.

    when HTTP_REQUEST {
    	if { [IP::client_addr] equals "172.16.37.16" && [HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0" && [HTTP::uri] ne "/evs/ent.msg.evs.ext.Notification_1.0?wsdl" } {
    		reject
    	}
    }