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 negativerandom(max)— returns a random number in the range from0tomax, excludingmaxrandom(min, max)— returns a random number in the range frommintomax, excludingmax. Ifminis greater thanmax, 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)