Skip to content

Commit 0510aad

Browse files
committed
docs: clarify that log filters remove lines if the filter matches
Signed-off-by: Xe Iaso <[email protected]>
1 parent a7a5e0d commit 0510aad

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

data/botPolicies.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,16 @@ logging:
142142
filters:
143143
# Every filter must have a name and an expression. You can use the same expression
144144
# syntax as you can with bots or thresholds.
145+
#
146+
# If the expression returns `true`, then the log line is filtered _out_.
145147
- name: "http-stdlib"
148+
# Log lines where the message starts with "http:" are filtered out.
146149
expression: msg.startsWith("http:")
147150
- name: "context-canceled"
151+
# Log lines relating to context cancellation are filtered out.
148152
expression: msg.contains("context canceled")
149153
- name: "http-pipelining"
154+
# Log lines relating to HTTP/1.1 pipelining being improperly handled are filtered out.
150155
expression: msg.contains("Unsolicited response received on idle HTTP channel")
151156

152157
# Open Graph passthrough configuration, see here for more information:

docs/docs/admin/configuration/expressions.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ Log filters are run on every time Anubis logs data. These are high throughput fi
197197
| `level` | `string` | The [log level](https://pkg.go.dev/log/slog#Level) for the log message. | `"INFO"` |
198198
| `attrs` | `map[string, string]` | The key -> value attributes for the given log line. Note that this is an expensive variable to access. | `{"err": "internal: the sun exploded"}` |
199199

200+
:::note
201+
202+
When you define a log filter, anything matching that filter is _removed_. Any remaining logs are sent through to the system journal or standard error.
203+
204+
:::
205+
200206
## Functions exposed to Anubis expressions
201207

202208
Anubis expressions can be augmented with the following functions:

0 commit comments

Comments
 (0)