Samples the event stream. Events that do not have the field being sampled are discarded.

ParameterTypeRequiredDefault ValueDescription
fieldstringoptional[a] @timestamp The names of the field to use for sampling events.
percentage[b]doubleoptional[a] 1 Keep this percentage of the events.
   Valid Values
   1
  Maximum100 

[a] Optional parameters use their default value unless explicitly set.

[b] The parameter name percentage can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

sample() Examples

Click + next to an example below to get the full details.

Sample Event Streams - Example 1

Sample events keeping only specified percentage of the events using the sample() function

Sample Event Streams - example 2

Sample events keeping only specified percentage of the events and sort by host using the sample() function with groupBy() and sort()