Skip to content

Commit f77c858

Browse files
committed
Merge remote-tracking branch 'upstream/main' into component-templates-tracking
* upstream/main: Fix MergeWithLowDiskSpaceIT testRelocationWhileForceMerging (elastic#131806) [ML] Prevent the trained model deployment memory estimation from double-counting allocations. (elastic#131990) ES|QL Assert current thread during query planning and execution (elastic#131807) Add ElasticsearchIndexDeletionPolicy and EngineConfig policy wrapper (elastic#130442) [TEST] Adds tests for ESTestCase randomSubset methods (elastic#131745) Simplify esql session (elastic#131925) Simplify EsqlExecution info serialization (elastic#131823) Add utility to check for project global block (elastic#131927) [DOCS] Update ES|QL applies to's (elastic#131805) Handle structured log messages (elastic#131027) Mute org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT test {p0=search/600_flattened_ignore_above/flattened ignore_above multi-value field} elastic#131967 Mute org.elasticsearch.xpack.remotecluster.CrossClusterEsqlRCS2EnrichUnavailableRemotesIT testEsqlEnrichWithSkipUnavailable elastic#131965 Mute org.elasticsearch.xpack.restart.FullClusterRestartIT testWatcherWithApiKey {cluster=UPGRADED} elastic#131964 [ES|QL] Fix aggregate_metric_double sorting and mv_expand issues (elastic#131658) Reduce logging levels for meter usage tests (elastic#131935)
2 parents 86c4db4 + 6bf55e4 commit f77c858

File tree

61 files changed

+1509
-411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1509
-411
lines changed

docs/changelog/131027.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 131027
2+
summary: Handle structured log messages
3+
area: Ingest Node
4+
type: feature
5+
issues:
6+
- 130333

docs/changelog/131658.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 131658
2+
summary: Fix `aggregate_metric_double` sorting and `mv_expand` issues
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/131990.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 131990
2+
summary: Prevent the trained model deployment memory estimation from double-counting
3+
allocations
4+
area: Machine Learning
5+
type: bug
6+
issues: []

docs/reference/enrich-processor/normalize-for-stream.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,87 @@ will be normalized into the following form:
153153
"trace_id": "abcdef1234567890abcdef1234567890"
154154
}
155155
```
156+
## Structured `message` field
157+
158+
If the `message` field in the ingested document is structured as a JSON, the
159+
processor will determine whether it is in ECS format or not, based on the
160+
existence or absence of the `@timestamp` field. If the `@timestamp` field is
161+
present, the `message` field will be considered to be in ECS format, and its
162+
contents will be merged into the root of the document and then normalized as
163+
described above. The `@timestamp` from the `message` field will override the
164+
root `@timestamp` field in the resulting document.
165+
If the `@timestamp` field is absent, the `message` field will be moved to
166+
the `body.structured` field as is, without any further normalization.
167+
168+
For example, if the `message` field is an ECS-JSON, as follows:
169+
170+
```json
171+
{
172+
"@timestamp": "2023-10-01T12:00:00Z",
173+
"message": "{\"@timestamp\":\"2023-10-01T12:01:00Z\",\"log.level\":\"INFO\",\"service.name\":\"my-service\",\"message\":\"The actual log message\",\"http\":{\"method\":\"GET\",\"url\":{\"path\":\"/api/v1/resource\"}}}"
174+
175+
}
176+
```
177+
it will be normalized into the following form:
178+
179+
```json
180+
{
181+
"@timestamp": "2023-10-01T12:01:00Z",
182+
"severity_text": "INFO",
183+
"body": {
184+
"text": "The actual log message"
185+
},
186+
"resource": {
187+
"attributes": {
188+
"service.name": "my-service"
189+
}
190+
},
191+
"attributes": {
192+
"http.method": "GET",
193+
"http.url.path": "/api/v1/resource"
194+
}
195+
}
196+
```
197+
198+
However, if the `message` field is not recognized as ECS format, as follows:
199+
200+
```json
201+
{
202+
"@timestamp": "2023-10-01T12:00:00Z",
203+
"log": {
204+
"level": "INFO"
205+
},
206+
"service": {
207+
"name": "my-service"
208+
},
209+
"tags": ["user-action", "api-call"],
210+
"message": "{\"root_cause\":\"Network error\",\"http\":{\"method\":\"GET\",\"url\":{\"path\":\"/api/v1/resource\"}}}"
211+
}
212+
```
213+
it will be normalized into the following form:
214+
215+
```json
216+
{
217+
"@timestamp": "2023-10-01T12:00:00Z",
218+
"severity_text": "INFO",
219+
"resource": {
220+
"attributes": {
221+
"service.name": "my-service"
222+
}
223+
},
224+
"attributes": {
225+
"tags": ["user-action", "api-call"]
226+
},
227+
"body": {
228+
"structured": {
229+
"root_cause": "Network error",
230+
"http": {
231+
"method": "GET",
232+
"url": {
233+
"path": "/api/v1/resource"
234+
}
235+
}
236+
}
237+
}
238+
}
239+
```

docs/reference/query-languages/esql/_snippets/functions/layout/categorize.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/sample.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/layout/scalb.md

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/query-languages/esql/_snippets/functions/parameters/categorize.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/IngestCommonPlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.elasticsearch.ingest.PipelineProcessor;
2222
import org.elasticsearch.ingest.Processor;
2323
import org.elasticsearch.plugins.ActionPlugin;
24+
import org.elasticsearch.plugins.ExtensiblePlugin;
2425
import org.elasticsearch.plugins.IngestPlugin;
2526
import org.elasticsearch.plugins.Plugin;
2627
import org.elasticsearch.rest.RestController;
@@ -33,7 +34,7 @@
3334

3435
import static java.util.Map.entry;
3536

36-
public class IngestCommonPlugin extends Plugin implements ActionPlugin, IngestPlugin {
37+
public class IngestCommonPlugin extends Plugin implements ActionPlugin, IngestPlugin, ExtensiblePlugin {
3738

3839
public IngestCommonPlugin() {}
3940

modules/ingest-otel/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ apply plugin: 'elasticsearch.internal-yaml-rest-test'
1212
esplugin {
1313
description = 'Ingest processor that normalizes ECS documents to OpenTelemetry-compatible namespaces'
1414
classname ='org.elasticsearch.ingest.otel.NormalizeForStreamPlugin'
15+
extendedPlugins = ['ingest-common']
16+
}
17+
18+
dependencies {
19+
compileOnly(project(':modules:ingest-common'))
20+
compileOnly project(':modules:lang-painless:spi')
21+
clusterModules project(':modules:ingest-common')
22+
clusterModules project(':modules:lang-painless')
1523
}
1624

1725
restResources {

0 commit comments

Comments
 (0)