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
Copy file name to clipboardExpand all lines: data/docs/userguide/parse-multiline-logs.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ This guide shows two ways to recombine multiline logs in OpenTelemetry Collector
19
19
20
20
Here is an example of multiline logs
21
21
22
-
```python
22
+
```text
23
23
2024-20-06 18:58:05,898 ERROR:Exception on main handler
24
24
Traceback (most recent call last):
25
25
File "python-logger.py", line 9, in make_log
@@ -28,7 +28,7 @@ IndexError: string index out of range
28
28
2024-20-06 18:58:05,898 DEBUG:Query Started
29
29
```
30
30
31
-
In the above example there there are two log lines spread over multiple line, but since by default each newline is treated as end of log line, multiple log lines will be created as seen in the image below.
31
+
The example above has two log entries spread over multiple lines. Since each newline is treated as the end of a log entry by default, the collector creates separate entries for each line:
@@ -39,13 +39,13 @@ In the above example there there are two log lines spread over multiple line, bu
39
39
40
40
## Parse Multiline Logs at Receiver
41
41
42
-
The [filelog receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/filelogreceiver/README.md) has a built-in `multiline` configuration block. This is the recommended approach because it recombines logs before they enter the pipeline.
42
+
The <ahref="https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/filelogreceiver/README.md"target="_blank"rel="noopener noreferrer nofollow">filelog receiver</a> has a built-in `multiline` configuration block. This is the recommended approach because it recombines logs before they enter the pipeline.
43
43
44
44
### Step 1: Identify the start or end pattern
45
45
46
46
Look at your log format and find a regex that matches the beginning (or end) of each log entry.
47
47
48
-
```python
48
+
```text
49
49
2024-20-06 18:58:05,898 ERROR:Exception on main handler
50
50
Traceback (most recent call last):
51
51
File "python-logger.py", line 9, in make_log
@@ -102,7 +102,7 @@ After deployment, the logs will appear as single entries in SigNoz:
102
102
103
103
### Using multiline in the SigNoz k8s-infra Helm chart
104
104
105
-
If you are running SigNoz on Kubernetes with the [k8s-infra Helm chart](https://github.com/SigNoz/charts/tree/main/charts/k8s-infra), use the `presets.logsCollection.multiline` key in your Helm values instead of editing the raw receiver config:
105
+
If you are running SigNoz on Kubernetes with the <a href="https://github.com/SigNoz/charts/tree/main/charts/k8s-infra" target="_blank" rel="noopener noreferrer nofollow">k8s-infra Helm chart</a>, use the `presets.logsCollection.multiline` key in your Helm values instead of editing the raw receiver config:
106
106
107
107
```yaml
108
108
presets:
@@ -115,7 +115,7 @@ The preset propagates this directly to the `filelog` receiver's `multiline` bloc
115
115
116
116
## Use Recombine Operator to Combine Multiline Logs
117
117
118
-
If you cannot use the receiver-level multiline configuration, you can use the [recombine](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/recombine.md) operator inside a `logstransform` processor.
118
+
If you cannot use the receiver-level multiline configuration, you can use the <a href="https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/stanza/docs/operators/recombine.md" target="_blank" rel="noopener noreferrer nofollow">recombine</a> operator inside a `logstransform` processor.
119
119
120
120
<Admonition type="warning">
121
121
The `logstransform` processor has development stability and is **not included in the official
@@ -128,7 +128,7 @@ If you cannot use the receiver-level multiline configuration, you can use the [r
128
128
129
129
Using the same example logs:
130
130
131
-
```python
131
+
```text
132
132
2024-20-06 18:58:05,898 ERROR:Exception on main handler
0 commit comments