File: random_sampling.rst

package info (click to toggle)
rsyslog 8.2512.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,464 kB
  • sloc: ansic: 123,809; sh: 42,109; makefile: 5,962; javascript: 1,842; python: 1,222; lex: 607; yacc: 193; perl: 162; sql: 103; tcl: 9; ruby: 2
file content (16 lines) | stat: -rw-r--r-- 518 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Random sampling
===============

Rsyslog supports various sampling mechanisms. These can be used on client systems to save servers from getting overwhelmed. Here we introduce a new sampling mechanism "Random sampling".

Let's consider a system that is generating logs at rate of 100 logs/sec.
If we want to get 20% of these logs uniformly sampled we use random sampling.

.. code-block:: none

  set $.rand = random(100);
  if ($.rand <= 20) then {
    //send out
  }

Above config will collect 20% of logs generated.