Radiator Server Documentation — v10.33.2

sometimes

Probabilistic pipeline execution

Table of Contents
  • sometimes
  • Syntax
  • Example
  • See Also

sometimes

Executes a pipeline probabilistically. Returns the pipeline's result if executed, or ignore if skipped.

Syntax

sometimes <probability> {
    actions...
} else {
    actions...
}

probability: Specify as percentage (10%) or ratio (1/10000 for fine-grained control)

The else block is optional and executes when the probability check fails.

Note: Plain numbers without % (e.g., 10) are supported for backwards compatibility but deprecated.

Example

Sample 10% of requests for detailed logging:

sometimes 10% {
    debug "User: %{aaa.identity} from %{radius.client.ip}";
} else {
    # Remaining 90% execute this
    debug "Skipped sampling";
}

See Also

Navigation
  • accept

  • all

  • any

  • append

  • assert

  • backend

  • challenge

  • chap

  • conditions

  • copy

  • count

  • debug

  • discard

  • each

  • eap

  • error

  • filter

  • first

  • hotp

  • http-basic-auth

  • if

  • ignore

  • invoke

  • log

  • map

  • message

  • modify

  • mschap

  • mschapv2

  • none

  • pap

  • reason

  • reject

  • reject_errors

  • replace

  • reply

  • rewrite

  • set

  • sleep

  • sometimes

  • stop

  • totp

  • trace

  • try

  • until

  • while

  • with

  • yubikey