Skip to content

Commit

Permalink
Documentation for the new filter severity settings (#107)
Browse files Browse the repository at this point in the history
Also unifies documentation with facility filter and rewrite-rules.
  • Loading branch information
therandomstring authored Jul 22, 2024
2 parents 49339f6 + 92cd7c9 commit 2cdd0b2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
13 changes: 13 additions & 0 deletions _includes/doc/admin-guide/options/filter-severity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

| Numerical Value | Equivalent Named Values |
|----------------:|-------------------------|
| 0 | emergency, emerg, panic |
| 1 | alert |
| 2 | critical, crit |
| 3 | error, err |
| 4 | warning, warn |
| 5 | notice |
| 6 | informational, info |
| 7 | debug |

Both numerical and named values are equally valid
4 changes: 4 additions & 0 deletions _includes/doc/admin-guide/warnings/dotdot-stringonly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

![]({{ site.baseurl}}/assets/images/caution.png) **CAUTION:**
The `..` notation can only be used with named values. Using it with numerical values is not supported.
{: .notice--warning}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ You can use the facility filter the following ways:

- Use a single facility code, for example, **facility(1)**

- Use a facility range (works only with facility names), for example,
- Use a facility range, for example,
**facility(local0..local5)**

{% include doc/admin-guide/warnings/dotdot-stringonly.md %}

The {{ site.product.short_name }} application recognizes the following facilities: (Note
that some of these facilities are available only on specific platforms.)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ every message of error or higher level, use the following filter:
```config
level(err..emerg)
```
{% include doc/admin-guide/warnings/dotdot-stringonly.md %}

The [[level() filter|adm-log-filters-level]] accepts the following levels: emerg, alert, crit,
err, warning, notice, info, debug.
The [[level() filter|adm-log-filters-level]] accepts the following levels:

{% include doc/admin-guide/options/filter-severity.md %}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: Setting severity with the set-severity() rewrite function
title: Setting severity with the [[set-severity()|adm-temp-severity]] rewrite function
short_title: Setting severity
id: adm-temp-severity
description: >-
It is possible to configure the severity field with the set-severity()
rewrite function. When configured, the set-severity() rewrite function
It is possible to configure the severity field with the [[set-severity()|adm-temp-severity]]
rewrite function. When configured, the [[set-severity()|adm-temp-severity]] rewrite function
will only rewrite the ${SEVERITY} field in the message to the first
parameter value specified in the function.
---
Expand All @@ -21,7 +21,7 @@ rewrite <name_of_the_rule> {

## Parameters

The set-severity() rewrite function has a single, mandatory parameter
The [[set-severity()|adm-temp-severity]] rewrite function has a single, mandatory parameter
that can be defined as follows:

```config
Expand All @@ -30,12 +30,9 @@ set-severity( "parameter1" );

## Accepted values

The set-severity() rewrite function accepts the following values:
The [[set-severity()|adm-temp-severity]] rewrite function accepts the following values:

- numeric strings: \[0-7\]

- named values: emerg, emergency, panic, alert, crit, critical, err,
error, warning, warn, notice, info, informational, debug
{% include doc/admin-guide/options/filter-severity.md %}

### Example usage for the set-severity() rewrite function

Expand All @@ -54,7 +51,7 @@ rewrite {

```config
rewrite {
set-severity("6");
set-severity(6);
};
```

Expand All @@ -65,3 +62,4 @@ rewrite {
set-severity("${.json.severity}");
};
```
{% include doc/admin-guide/warnings/dotdot-stringonly.md %}

0 comments on commit 2cdd0b2

Please sign in to comment.