Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add instruction to remove unwanted attributes from systemd logs #3027

Merged
merged 3 commits into from
Sep 8, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Fluentd](#fluentd-1)
- [OpenTelemetry Collector](#opentelemetry-collector-1)
- [Collect logs from additional files on the Node](#collect-logs-from-additional-files-on-the-node)
- [Remove attributes from systemd logs](#removing-attributes-from-systemd-logs)
- [Filtering Prometheus Metrics by Namespace](#filtering-prometheus-metrics-by-namespace)
- [Modify the Log Level for Falco](#modify-the-log-level-for-falco)
- [Overriding metadata using annotations](#overriding-metadata-using-annotations)
Expand Down Expand Up @@ -353,6 +354,26 @@ In the example above, two internally defined processors were used in metadata pi
[memory limiter](https://github.com/open-telemetry/opentelemetry-collector/tree/v0.73.0/processor/memorylimiterprocessor). If you need to
change the parameters of these processors in any way, you can define your own and use them in this pipeline.

## Removing attributes from systemd logs

If you want to remove some attributes from Systemd logs, like for example `PRIORITY` and `SYSLOG_FACILITY`, you can do it the following way:

```yaml
sumologic:
logs:
systemd:
otelcol:
extraProcessors:
- transform/cleanup_systemd:
log_statements:
- context: log
statements:
- delete_key(body, "PRIORITY")
- delete_key(body, "SYSLOG_FACILITY")
```

**Note: We do not guarantee that the structure of `otellogs.config.merge` will remain the same between minor helm chart versions**
sumo-drosiek marked this conversation as resolved.
Show resolved Hide resolved

## Filtering Prometheus Metrics by Namespace

If you want to filter metrics by namespace, it can be done in the prometheus remote write config. Here is an example of excluding kube-state
Expand Down