Fortinet white logo
Fortinet white logo

Script Reference Guide

LB:get_current_routing()

LB:get_current_routing()

Returns the currently allocated backend for this request.

If there is only one backend configured, this function returns the backend name in a string format. If there are multiple backends available, and they are already set via LB:routing(), then this function returns the backend name as a string. Otherwise, this returns an empty string if no backend is configured.

In case of a single routing with zero or one content routing configured, the pool name will be returned.

Syntax

LB:get_current_routing();

Arguments

N/A

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_DATA_REQUEST

  • AUTH_RESULT

Example

when HTTP_REQUEST {
t=LB:get_current_routing()
if (s == nil or s == '') then
       s = "No backend returned."
       end
      debug("current routing: %s\n", s).
}

Supported Version

FortiADC version 7.4.2 and later.

LB:get_current_routing()

LB:get_current_routing()

Returns the currently allocated backend for this request.

If there is only one backend configured, this function returns the backend name in a string format. If there are multiple backends available, and they are already set via LB:routing(), then this function returns the backend name as a string. Otherwise, this returns an empty string if no backend is configured.

In case of a single routing with zero or one content routing configured, the pool name will be returned.

Syntax

LB:get_current_routing();

Arguments

N/A

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_DATA_REQUEST

  • AUTH_RESULT

Example

when HTTP_REQUEST {
t=LB:get_current_routing()
if (s == nil or s == '') then
       s = "No backend returned."
       end
      debug("current routing: %s\n", s).
}

Supported Version

FortiADC version 7.4.2 and later.