Fortinet white logo
Fortinet white logo

Script Reference Guide

PROXY:atomic_counter_dec(counter_name)

PROXY:atomic_counter_dec(counter_name)

Decreases the current value of the specified atomic counter name by one.

Syntax

PROXY:atomic_counter_dec(counter_name);

Arguments

Name Description
counter_name

A Lua string as the name of the counter. This parameter is mandatory.

Events

All events except: PERSISTENCE, POST_PERSIST.

Example

when HTTP_REQUEST {
       counter_name = "DemoCounter1"
       ret = PROXY:atomic_counter_dec(counter_name)
       if ret then
             debug("===>>atomic_counter_dec success: [%s]\n", counter_name)
       else
             debug("===>>atomic_counter_dec failed: [%s]\n", counter_name)
       end
}

Supported Version

FortiADC version 7.6.0 and later.

PROXY:atomic_counter_dec(counter_name)

PROXY:atomic_counter_dec(counter_name)

Decreases the current value of the specified atomic counter name by one.

Syntax

PROXY:atomic_counter_dec(counter_name);

Arguments

Name Description
counter_name

A Lua string as the name of the counter. This parameter is mandatory.

Events

All events except: PERSISTENCE, POST_PERSIST.

Example

when HTTP_REQUEST {
       counter_name = "DemoCounter1"
       ret = PROXY:atomic_counter_dec(counter_name)
       if ret then
             debug("===>>atomic_counter_dec success: [%s]\n", counter_name)
       else
             debug("===>>atomic_counter_dec failed: [%s]\n", counter_name)
       end
}

Supported Version

FortiADC version 7.6.0 and later.