Radiator Server Documentation — v10.33.2

Lua script context API - Accounting sub-context

Table of Contents
  • acct
  • Fields
  • Counters Object
  • Example

acct

Accounting request data (available for accounting requests).

Fields

FieldTypeAccessDescription
statusstring?readAccounting status (Start, Stop, Interim-Update, etc.)
timestampstring?readAccounting request timestamp
durationstring?readSession duration
inputcounters?readInput traffic counters
outputcounters?readOutput traffic counters

Counters Object

FieldTypeDescription
packetsnumber?Packet count
bytesnumber?Byte count

Example

local context, previous = ...

local acct = context.acct

if acct.status == "Stop" then
    local duration = acct.duration
    local bytes_in = acct.input and acct.input.bytes or 0
    local bytes_out = acct.output and acct.output.bytes or 0
end

return previous
Navigation
  • @verification

  • aaa

  • backends

  • caches

  • captures

  • certificates

  • clients

  • conditions

  • dictionary

  • hmac-otp

  • include

  • init

  • ip-accept

  • license

  • logging

  • management

  • proxy-protocol

  • scripts

    • context

      • aaa

      • acct

      • auth

      • cache

      • cert

      • eap

      • eap_teap

      • eap_ttls

      • http

      • radius

      • radiusproxy

      • stats

      • tls

      • user

      • vars

  • servers

  • statistics

  • stats

  • template

  • ui