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: solutions/observability/logs/filter-aggregate-logs.md
+30-28Lines changed: 30 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,9 @@ This guide shows you how to:
29
29
::::
30
30
31
31
32
-
The examples on this page use the following ingest pipeline and index template, which you can set in **Developer Tools**. If you haven’t used ingest pipelines and index templates to parse your log data and extract structured fields yet, start with the [Parse and organize logs](/solutions/observability/logs/parse-route-logs.md) documentation.
32
+
The examples on this page use the following ingest pipeline and index template. The pipeline and template need to be set before you create your data stream in the following steps. Set them in **Developer Tools**, which you can find by searching for `Developer Tools` in the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md).
33
+
34
+
If you haven't used ingest pipelines and index templates to parse your log data and extract structured fields yet, start with the [Parse and organize logs](/solutions/observability/logs/parse-route-logs.md) documentation.
33
35
34
36
Set the ingest pipeline with the following command:
35
37
@@ -94,28 +96,28 @@ Add some logs with varying timestamps and log levels to your data stream:
94
96
```console
95
97
POST logs-example-default/_bulk
96
98
{ "create": {} }
97
-
{ "message": "2023-09-15T08:15:20.234Z WARN 192.168.1.101 Disk usage exceeds 90%." }
99
+
{ "message": "2025-04-15T08:15:20.234Z WARN 192.168.1.101 Disk usage exceeds 90%." }
98
100
{ "create": {} }
99
-
{ "message": "2023-09-14T10:30:45.789Z ERROR 192.168.1.102 Critical system failure detected." }
101
+
{ "message": "2025-04-14T10:30:45.789Z ERROR 192.168.1.102 Critical system failure detected." }
{ "message": "2023-09-20T09:40:32.345Z INFO 192.168.1.106 User logout initiated." }
152
+
{ "message": "2025-04-20T09:40:32.345Z INFO 192.168.1.106 User logout initiated." }
151
153
```
152
154
153
-
Let’s say you want to look into an event that occurred between September 14th and 15th. The following boolean query filters for logs with timestamps during those days that also have a log level of `ERROR` or `WARN`.
155
+
Let’s say you want to look into an event that occurred between April 14th and 15th. The following boolean query filters for logs with timestamps during those days that also have a log level of `ERROR` or `WARN`.
154
156
155
157
```console
156
158
POST /logs-example-default/_search
@@ -161,8 +163,8 @@ POST /logs-example-default/_search
161
163
{
162
164
"range": {
163
165
"@timestamp": {
164
-
"gte": "2023-09-14T00:00:00",
165
-
"lte": "2023-09-15T23:59:59"
166
+
"gte": "2025-04-14T00:00:00",
167
+
"lte": "2025-04-15T23:59:59"
166
168
}
167
169
}
168
170
},
@@ -186,27 +188,27 @@ The filtered results should show `WARN` and `ERROR` logs that occurred within th
0 commit comments