Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:enable_event(code)

HTTP:enable_event(code)

Enables an event that was previously disabled based on the code specified via the parameter.

Syntax

HTTP:enable_event(code)

Arguments

Parameter

Description

code

A Lua integer in hex format to indicate the event.

  • 0x01 — EVENT_REQUEST_CODE

  • 0x02 — EVENT_RESPONSE_CODE

  • 0x04 —EVENT_DISBALE_DATA_REQUEST_CODE

  • 0x08 — EVENT_DISABLE_DATA_RESPONSE_CODE

  • 0x10 — EVENT_REQ_SSL_HANDSHAKE_CODE

  • 0x20 — EVENT_REP_SSL_HANDSHAKE_CODE

  • 0x40 — EVENT_TCP_ACCEPTED_CODE

  • 0x80 — EVENT_TCP_CLOSED_CODE

  • 0x100 — EVENT_REQ_SSL_RENEGOTIATE_CODE

  • 0x200 — EVENT_REP_SSL_RENEGOTIATE_CODE

  • 0x400 — EVENT_SERVER_CONNECTED_CODE

  • 0x800 — EVENT_SERVER_CLOSED_CODE

  • 0x1000 — EVENT_BEFORE_CONNECT_CODE

  • 0x2000 — EVENT_AUTH_RESULT_CODE

  • 0x4000 — EVENT_COOKIE_BAKE_CODE

  • 0x8000 — EVENT_PERSIST_CODE

Events

  • HTTP_REQUEST

  • HTTP_RESPONSE

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

  • BEFORE_AUTH

  • WAF_REQUEST_BEFORE_SCAN

  • WAF_RESPONSE_BEFORE_SCAN

  • WAF_REQUEST_ATTACK_DETECTED

  • WAF_RESPONSE_ATTACK_DETECTED

Example

In this example, the BEFORE_CONNECT event (code 0x1000) was previously disabled via HTTP:disable_event(). Once code 0x1000 is enabled, the corresponding event function can be called again.

when HTTP_REQUEST {
          HTTP:enable_event(0x1000)
}
when SERVER_BEFORE_CONNECT {
    debug("------> Events: SERVER_BEFORE_CONNECT begin:[%s]\n", ctime())
    cip = IP:client_addr()
    debug("------> client IP %s\n", cip)
    debug("------> Events: SERVER_BEFORE_CONNECT end:[%s]\n", ctime())
}

Supported Version

FortiADC version 5.0.x and later.

HTTP:enable_event(code)

HTTP:enable_event(code)

Enables an event that was previously disabled based on the code specified via the parameter.

Syntax

HTTP:enable_event(code)

Arguments

Parameter

Description

code

A Lua integer in hex format to indicate the event.

  • 0x01 — EVENT_REQUEST_CODE

  • 0x02 — EVENT_RESPONSE_CODE

  • 0x04 —EVENT_DISBALE_DATA_REQUEST_CODE

  • 0x08 — EVENT_DISABLE_DATA_RESPONSE_CODE

  • 0x10 — EVENT_REQ_SSL_HANDSHAKE_CODE

  • 0x20 — EVENT_REP_SSL_HANDSHAKE_CODE

  • 0x40 — EVENT_TCP_ACCEPTED_CODE

  • 0x80 — EVENT_TCP_CLOSED_CODE

  • 0x100 — EVENT_REQ_SSL_RENEGOTIATE_CODE

  • 0x200 — EVENT_REP_SSL_RENEGOTIATE_CODE

  • 0x400 — EVENT_SERVER_CONNECTED_CODE

  • 0x800 — EVENT_SERVER_CLOSED_CODE

  • 0x1000 — EVENT_BEFORE_CONNECT_CODE

  • 0x2000 — EVENT_AUTH_RESULT_CODE

  • 0x4000 — EVENT_COOKIE_BAKE_CODE

  • 0x8000 — EVENT_PERSIST_CODE

Events

  • HTTP_REQUEST

  • HTTP_RESPONSE

  • HTTP_DATA_REQUEST

  • HTTP_DATA_RESPONSE

  • BEFORE_AUTH

  • WAF_REQUEST_BEFORE_SCAN

  • WAF_RESPONSE_BEFORE_SCAN

  • WAF_REQUEST_ATTACK_DETECTED

  • WAF_RESPONSE_ATTACK_DETECTED

Example

In this example, the BEFORE_CONNECT event (code 0x1000) was previously disabled via HTTP:disable_event(). Once code 0x1000 is enabled, the corresponding event function can be called again.

when HTTP_REQUEST {
          HTTP:enable_event(0x1000)
}
when SERVER_BEFORE_CONNECT {
    debug("------> Events: SERVER_BEFORE_CONNECT begin:[%s]\n", ctime())
    cip = IP:client_addr()
    debug("------> client IP %s\n", cip)
    debug("------> Events: SERVER_BEFORE_CONNECT end:[%s]\n", ctime())
}

Supported Version

FortiADC version 5.0.x and later.