You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Configure the `transform/logs` processor**: In the `agent.yaml` apply the processor to `log_statements` in the `resource` context and retain only relevant resource attributes (`com.splunk.sourcetype`, `host.name`, `otelcol.service.mode`):
9
+
**Configure the `transform` processor** and name it `/logs`.
10
+
By using the `-context: resource` key we are targeting the **resourceLog** attributes of logs.
11
+
This configuration ensures that only the relevant resource attributes (`com.splunk.sourcetype`, `host.name`, `otelcol.service.mode`) are retained, improving log efficiency and reducing unnecessary metadata.
This configuration ensures that only the specified attributes are retained, improving log efficiency and reducing unnecessary metadata.
20
-
21
-
**Adding a Context Block for Log Severity Mapping**: To properly set the `severity_text` and `severity_number` fields of a log record, add another log `context` block within `log_statements`. This configuration extracts the `level` value from the log body, maps it to `severity_text`, and assigns the appropriate `severity_number`:
21
+
**Adding a Context Block for Log Severity Mapping**:
22
+
To properly set the `severity_text` and `severity_number` fields of a log record, we add another log `context` block within `log_statements`.
23
+
This configuration extracts the `level` value from the log body, maps it to `severity_text`, and assigns the appropriate `severity_number`:
22
24
23
25
```yaml
24
26
- context: log # Log Context
@@ -52,16 +54,16 @@ This method of mapping all JSON fields to top-level attributes should only be us
52
54
**Update the `logs` pipeline**: Add the `transform/logs:` processor into the `logs:` pipeline:
53
55
54
56
```yaml
55
-
logs: # Logs Pipeline
56
-
receivers: # Array of receivers in this pipeline
57
-
- filelog/quotes
58
-
- otlp
59
-
processors: # Array of Processors in this pipeline
60
-
- memory_limiter # You also could use [memory_limiter]
0 commit comments