Forum Discussion

Ayrton_Miguel_S's avatar
Ayrton_Miguel_S
Icon for Nimbostratus rankNimbostratus
Feb 18, 2016

http_class to irule conversion

Does anyone know how to convert a http_class to an irule, the code it's the below.

 

when HTTP_CLASS_SELECTED { if {[HTTP::class asm] == 1 } {

 

    if {$disable_asm == 1 } {
        ASM::disable
    }
    else {
        ASM::enable
    }

} }

 

1 Reply

  • Hi Ayrton Miguel Salazar Cortes,

    you may try the following syntax as a starting point...

    when HTTP_REQUEST {
        set asm_policy "/Common/YOUR_ASM_POLICY"
        if { $asm_policy ne "" } then {
            ASM::enable $asm_policy
        } else {
            ASM::disable
        }
    }
    

    Note: Keep in mind that you have to assign at least one ASM_POLICY (could be a dummy policy) to your Virtual Server to execute the

    [ASM::enable]
    or
    [ASM::disable]
    commands.

    Cheers, Kai