Skip to main content
Version: 6.1

Stats Operations

max

Description: Takes parameters separated by commas and returns the largest one.

info

Text values are considered larger than numeric values.

In the example, res will have the value "foo", and res1 will have the value 22.1.

Example #1
... | eval res=max(1, 3, 6, 7, "foo"), res1=max(1, 3, 6, 5.5, 7, 22.1)

min

Description: Takes parameters separated by commas and returns the smallest one.

info

Text values are considered larger than numeric values.

In the example, res will have the value 1, and res1 will have the value 1.

Example #1
... | eval res=min(1, 3, 6, 7, "foo"), res1=min(1, 3, 6, 5.5, 7, 22.1)

random

Call variants:

  • random() — returns a random integer, which may be negative
  • random(max) — returns a random number in the range from 0 to max, excluding max
  • random(min, max) — returns a random number in the range from min to max, excluding max. If min is greater than max, the request fails with an error

Description: Returns a random number.

Example №1
... | eval res=random()
Example №2
... | eval res=random(10, 20)
Example №3
... | eval res=random(10, 20)