Skip to content

Commit 61d1019

Browse files
committed
Reformat and update of stats() section
Signed-off-by: mrgarris0n <gergely.karacsonyi@gmail.com>
1 parent 739626f commit 61d1019

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

doc/_admin-guide/090_Global_options/000_Global_options.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ driver.
338338

339339
## stats()
340340

341-
Available in {{ site.product.short_name }} 4.1 and later versions.
341+
Available in {{ site.product.short_name }} 4.1 and later versions, introduced by Axoflow.
342342

343343
*Description:* The stats() option is an aggregated collection of statistic-related sub-options.
344344

@@ -358,12 +358,16 @@ options {
358358

359359
The following sub-options are available within the stats() option:
360360

361-
- freq()
361+
### freq()
362362

363-
| Accepted values:| number|
363+
| Accepted values:| number (seconds)|
364364
|Default:| 600|
365365

366-
- level()
366+
*Description:* The period between two STATS messages in seconds. STATS
367+
are log messages sent by syslog-ng, containing statistics about dropped
368+
log messages. Set to **0** to disable the STATS messages.
369+
370+
### level()
367371

368372
| Accepted values:| 0, 1, 2, 3|
369373
|Default:| 0|
@@ -379,8 +383,16 @@ The following sub-options are available within the stats() option:
379383
- Level 3 contains detailed statistics based on various message parameters like facility, severity, or tags.
380384

381385
**NOTE:** Level 2 and 3 increase the memory requirements and CPU load. For details on message statistics, see Statistics of syslog-ng.
386+
{: .notice--info}
387+
388+
### lifetime()
382389

383-
- max-dynamics()
390+
| Accepted values:| number (seconds)|
391+
|Default:| N/A|
392+
393+
*Description:* Dynamic counters in metrics are pruned after lifetime expires. Note that orphaned counters are not pruned (you can prune them by running `syslog-ng-ctl stats --remove-orphans`)
394+
395+
### max-dynamics()
384396

385397
| Accepted values:| number|
386398
|Default:| N/A|
@@ -392,27 +404,28 @@ The following sub-options are available within the stats() option:
392404
If this option is not used, dynamic counters are not limited. This can be useful in cases where you are extremely interested in dynamic counters, and use these statistics extensively.
393405

394406
![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:** In some cases, there might be even millions of dynamic counters.
407+
{: .notice--warning}
395408

396409
- **Limited dynamic counter clusters:**
397410

398-
To limit dynamic counters, enter a number, and only a maximum of <number> counters will be registered in the statistics.
411+
To limit dynamic counters, enter a number, and only a maximum of \<number\> counters will be registered in the statistics.
399412

400413
In practice, this means dynamic counter clusters. A program name produces one dynamic counter cluster, that can include several counters, such as processed, stamp, and so on.
401414

402415
**Example: Limiting dynamic counter clusters 1:**
403416

404-
If stats-max-dynamics() is set to 1, and 2 programs send messages, only one of these programs will be tracked in the dynamic counters, but it will have more than one counters.
405-
417+
If max-dynamics() is set to 1, and 2 programs send messages, only one of these programs will be tracked in the dynamic counters, but it will have more than one counters.
406418

407419
**Example: Limiting dynamic counter clusters 2:**
408420

409-
If you have 500 clients, and set stats-max-dynamics() to 1000, you will have enough number of counters reserved for these clients, but at the same time, you limit the use of your resources and therefore protect your system from being overloaded.
421+
If you have 500 clients, and set max-dynamics() to 1000, you will have enough number of counters reserved for these clients, but at the same time, you limit the use of your resources and therefore protect your system from being overloaded.
410422

411423
- **No dynamic counters:**
412424

413425
To disable dynamic counters completely, set the value of this option to 0. This is the recommended value if statistics are not used, or if dynamic counters are irrelevant (for example, the number of logs arriving from programs).
414426

415-
**NOTE:** If a lower value is set to stats-max-dynamics() (or, any limiting value, if this option has not been configured before) and {{ site.product.short_name }} is restarted, the changes are only applied after stats-freq() time has passed. That is, the previously allocated dynamic clusters are only removed after this time.
427+
**NOTE:** If a lower value is set to max-dynamics() (or, any limiting value, if this option has not been configured before) and {{ site.product.short_name }} is restarted, the changes are only applied after freq() time has passed. That is, the previously allocated dynamic clusters are only removed after this time.
428+
{: .notice--info}
416429

417430
## so-passcred()
418431

@@ -442,19 +455,19 @@ Possible values:
442455

443456
## stats-freq() (DEPRECATED)
444457

445-
This is a deprecated legacy option. Use the stats() option.
458+
This is a deprecated legacy option. Use stats(freq()) instead.
446459

447460
## stats-level() (DEPRECATED)
448461

449-
This is a deprecated legacy option. Use the stats() option.
462+
This is a deprecated legacy option. Use stats(level()) instead.
450463

451464
## stats-max-dynamics() (DEPRECATED)
452465

453-
This is a deprecated legacy option. Use the stats() option.
466+
This is a deprecated legacy option. Use stats(max-dynamics()) instead.
454467

455468
## sync() or sync-freq() (DEPRECATED)
456469

457-
This is a deprecated legacy option. Use the stats() option.
470+
Obsolete aliases for flush-lines().
458471

459472
## threaded()
460473

doc/_admin-guide/190_The_syslog-ng_manual_pages/007_syslog-ng_control_tool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ The stats command has the following options:
223223
>dst.file;#anon-destination0#0;/tmp/2021-08-17.log;o;processed;156
224224
>dst.file;#anon-destination0#0;/tmp/2021-08-18.log;a;processed;961
225225
226-
**NOTE:** The stats-lifetime() can be used to do the same
227-
automatically and periodically, but currently stats-lifetime()
226+
**NOTE:** The stats(lifetime()) can be used to do the same
227+
automatically and periodically, but currently stats(lifetime())
228228
removes only dynamic counters that have a timestamp field set.
229229
{: .notice--info}
230230

0 commit comments

Comments
 (0)