Skip to content

Commit b716a53

Browse files
authored
Change deprecation.elasticsearch keyword to elasticsearch.deprecation (#117933)
Changes the values of the "data_stream.dataset" and "event.dataset" fields to be "elasticsearch.deprecation" instead of "deprecation.elasticsearch".
1 parent 774c6ea commit b716a53

File tree

7 files changed

+54
-37
lines changed

7 files changed

+54
-37
lines changed

distribution/src/config/log4j2.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ appender.deprecation_rolling.name = deprecation_rolling
6363
appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.json
6464
appender.deprecation_rolling.layout.type = ECSJsonLayout
6565
# Intentionally follows a different pattern to above
66-
appender.deprecation_rolling.layout.dataset = deprecation.elasticsearch
66+
appender.deprecation_rolling.layout.dataset = elasticsearch.deprecation
6767
appender.deprecation_rolling.filter.rate_limit.type = RateLimitingFilter
6868

6969
appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.json.gz

docs/changelog/117933.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pr: 117933
2+
summary: Change `deprecation.elasticsearch` keyword to `elasticsearch.deprecation`
3+
area: Infra/Logging
4+
type: bug
5+
issues:
6+
- 83251
7+
breaking:
8+
title: Deprecation logging value change for "data_stream.dataset" and "event.dataset"
9+
area: Logging
10+
details: |-
11+
This change modifies the "data_stream.dataset" and "event.dataset" value for deprecation logging
12+
to use the value `elasticsearch.deprecation` instead of `deprecation.elasticsearch`. This is now
13+
consistent with other values where the name of the service is the first part of the key.
14+
impact: |-
15+
If you are directly consuming deprecation logs for "data_stream.dataset" and "event.dataset" and filtering on
16+
this value, you will need to update your filters to use `elasticsearch.deprecation` instead of
17+
`deprecation.elasticsearch`.
18+
notable: false

qa/logging-config/src/test/java/org/elasticsearch/common/logging/JsonLoggerTests.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException {
125125
jsonLogs,
126126
contains(
127127
allOf(
128-
hasEntry("event.dataset", "deprecation.elasticsearch"),
128+
hasEntry("event.dataset", "elasticsearch.deprecation"),
129129
hasEntry("log.level", "CRITICAL"),
130130
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
131131
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
132132
hasEntry("elasticsearch.node.name", "sample-name"),
133133
hasEntry("message", "deprecated message1"),
134134
hasEntry("data_stream.type", "logs"),
135-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
135+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
136136
hasEntry("data_stream.namespace", "default"),
137137
hasKey("ecs.version"),
138138
hasEntry(DeprecatedMessage.KEY_FIELD_NAME, "a key"),
@@ -168,8 +168,8 @@ public void testCompatibleLog() throws Exception {
168168
contains(
169169
allOf(
170170
hasEntry("log.level", "CRITICAL"),
171-
hasEntry("event.dataset", "deprecation.elasticsearch"),
172-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
171+
hasEntry("event.dataset", "elasticsearch.deprecation"),
172+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
173173
hasEntry("data_stream.namespace", "default"),
174174
hasEntry("data_stream.type", "logs"),
175175
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
@@ -186,8 +186,8 @@ public void testCompatibleLog() throws Exception {
186186
allOf(
187187
hasEntry("log.level", "CRITICAL"),
188188
// event.dataset and data_stream.dataset have to be the same across the data stream
189-
hasEntry("event.dataset", "deprecation.elasticsearch"),
190-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
189+
hasEntry("event.dataset", "elasticsearch.deprecation"),
190+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
191191
hasEntry("data_stream.namespace", "default"),
192192
hasEntry("data_stream.type", "logs"),
193193
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
@@ -240,8 +240,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
240240
// deprecation log for field deprecated_name
241241
allOf(
242242
hasEntry("log.level", "WARN"),
243-
hasEntry("event.dataset", "deprecation.elasticsearch"),
244-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
243+
hasEntry("event.dataset", "elasticsearch.deprecation"),
244+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
245245
hasEntry("data_stream.namespace", "default"),
246246
hasEntry("data_stream.type", "logs"),
247247
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
@@ -258,8 +258,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
258258
// deprecation log for field deprecated_name2 (note it is not being throttled)
259259
allOf(
260260
hasEntry("log.level", "WARN"),
261-
hasEntry("event.dataset", "deprecation.elasticsearch"),
262-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
261+
hasEntry("event.dataset", "elasticsearch.deprecation"),
262+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
263263
hasEntry("data_stream.namespace", "default"),
264264
hasEntry("data_stream.type", "logs"),
265265
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
@@ -276,8 +276,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
276276
// compatible log line
277277
allOf(
278278
hasEntry("log.level", "CRITICAL"),
279-
hasEntry("event.dataset", "deprecation.elasticsearch"),
280-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
279+
hasEntry("event.dataset", "elasticsearch.deprecation"),
280+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
281281
hasEntry("data_stream.namespace", "default"),
282282
hasEntry("data_stream.type", "logs"),
283283
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
@@ -327,14 +327,14 @@ public void testDeprecatedMessage() throws Exception {
327327
jsonLogs,
328328
contains(
329329
allOf(
330-
hasEntry("event.dataset", "deprecation.elasticsearch"),
330+
hasEntry("event.dataset", "elasticsearch.deprecation"),
331331
hasEntry("log.level", "WARN"),
332332
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
333333
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
334334
hasEntry("elasticsearch.node.name", "sample-name"),
335335
hasEntry("message", "deprecated message1"),
336336
hasEntry("data_stream.type", "logs"),
337-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
337+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
338338
hasEntry("data_stream.namespace", "default"),
339339
hasKey("ecs.version"),
340340
hasEntry(DeprecatedMessage.KEY_FIELD_NAME, "someKey"),
@@ -579,7 +579,7 @@ public void testDuplicateLogMessages() throws Exception {
579579
jsonLogs,
580580
contains(
581581
allOf(
582-
hasEntry("event.dataset", "deprecation.elasticsearch"),
582+
hasEntry("event.dataset", "elasticsearch.deprecation"),
583583
hasEntry("log.level", "CRITICAL"),
584584
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
585585
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
@@ -612,7 +612,7 @@ public void testDuplicateLogMessages() throws Exception {
612612
jsonLogs,
613613
contains(
614614
allOf(
615-
hasEntry("event.dataset", "deprecation.elasticsearch"),
615+
hasEntry("event.dataset", "elasticsearch.deprecation"),
616616
hasEntry("log.level", "CRITICAL"),
617617
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
618618
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
@@ -622,7 +622,7 @@ public void testDuplicateLogMessages() throws Exception {
622622
hasEntry("elasticsearch.event.category", "other")
623623
),
624624
allOf(
625-
hasEntry("event.dataset", "deprecation.elasticsearch"),
625+
hasEntry("event.dataset", "elasticsearch.deprecation"),
626626
hasEntry("log.level", "CRITICAL"),
627627
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
628628
hasEntry("elasticsearch.cluster.name", "elasticsearch"),

qa/logging-config/src/test/resources/org/elasticsearch/common/logging/json_layout/log4j2.properties

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ appender.deprecated.name = deprecated
1515
appender.deprecated.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecated.json
1616
# Intentionally follows a different pattern to above
1717
appender.deprecated.layout.type = ECSJsonLayout
18-
appender.deprecated.layout.dataset = deprecation.elasticsearch
18+
appender.deprecated.layout.dataset = elasticsearch.deprecation
1919
appender.deprecated.filter.rate_limit.type = RateLimitingFilter
2020

2121
appender.deprecatedconsole.type = Console
2222
appender.deprecatedconsole.name = deprecatedconsole
2323
appender.deprecatedconsole.layout.type = ECSJsonLayout
24-
# Intentionally follows a different pattern to above
25-
appender.deprecatedconsole.layout.dataset = deprecation.elasticsearch
24+
appender.deprecatedconsole.layout.dataset = elasticsearch.deprecation
2625
appender.deprecatedconsole.filter.rate_limit.type = RateLimitingFilter
2726

2827

server/src/main/java/org/elasticsearch/common/logging/DeprecatedMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private static ESLogMessage getEsLogMessage(
5757
String messagePattern,
5858
Object[] args
5959
) {
60-
ESLogMessage esLogMessage = new ESLogMessage(messagePattern, args).field("data_stream.dataset", "deprecation.elasticsearch")
60+
ESLogMessage esLogMessage = new ESLogMessage(messagePattern, args).field("data_stream.dataset", "elasticsearch.deprecation")
6161
.field("data_stream.type", "logs")
6262
.field("data_stream.namespace", "default")
6363
.field(KEY_FIELD_NAME, key)

x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,12 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception {
339339
hasEntry("elasticsearch.event.category", "settings"),
340340
hasKey("elasticsearch.node.id"),
341341
hasKey("elasticsearch.node.name"),
342-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
342+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
343343
hasEntry("data_stream.namespace", "default"),
344344
hasEntry("data_stream.type", "logs"),
345345
hasKey("ecs.version"),
346346
hasEntry(KEY_FIELD_NAME, "deprecated_settings"),
347-
hasEntry("event.dataset", "deprecation.elasticsearch"),
347+
hasEntry("event.dataset", "elasticsearch.deprecation"),
348348
hasEntry("log.level", "WARN"),
349349
hasKey("log.logger"),
350350
hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead")
@@ -357,12 +357,12 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception {
357357
hasEntry("elasticsearch.event.category", "api"),
358358
hasKey("elasticsearch.node.id"),
359359
hasKey("elasticsearch.node.name"),
360-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
360+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
361361
hasEntry("data_stream.namespace", "default"),
362362
hasEntry("data_stream.type", "logs"),
363363
hasKey("ecs.version"),
364364
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"),
365-
hasEntry("event.dataset", "deprecation.elasticsearch"),
365+
hasEntry("event.dataset", "elasticsearch.deprecation"),
366366
hasEntry("log.level", "WARN"),
367367
hasKey("log.logger"),
368368
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")
@@ -402,12 +402,12 @@ public void testDeprecationCriticalWarnMessagesCanBeIndexed() throws Exception {
402402
hasEntry("elasticsearch.event.category", "settings"),
403403
hasKey("elasticsearch.node.id"),
404404
hasKey("elasticsearch.node.name"),
405-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
405+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
406406
hasEntry("data_stream.namespace", "default"),
407407
hasEntry("data_stream.type", "logs"),
408408
hasKey("ecs.version"),
409409
hasEntry(KEY_FIELD_NAME, "deprecated_critical_settings"),
410-
hasEntry("event.dataset", "deprecation.elasticsearch"),
410+
hasEntry("event.dataset", "elasticsearch.deprecation"),
411411
hasEntry("log.level", "CRITICAL"),
412412
hasKey("log.logger"),
413413
hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead")
@@ -443,12 +443,12 @@ public void testDeprecationWarnMessagesCanBeIndexed() throws Exception {
443443
hasEntry("elasticsearch.event.category", "settings"),
444444
hasKey("elasticsearch.node.id"),
445445
hasKey("elasticsearch.node.name"),
446-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
446+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
447447
hasEntry("data_stream.namespace", "default"),
448448
hasEntry("data_stream.type", "logs"),
449449
hasKey("ecs.version"),
450450
hasEntry(KEY_FIELD_NAME, "deprecated_warn_settings"),
451-
hasEntry("event.dataset", "deprecation.elasticsearch"),
451+
hasEntry("event.dataset", "elasticsearch.deprecation"),
452452
hasEntry("log.level", "WARN"),
453453
hasKey("log.logger"),
454454
hasEntry("message", "[deprecated_warn_settings] usage is deprecated but won't be breaking in next version")
@@ -461,12 +461,12 @@ public void testDeprecationWarnMessagesCanBeIndexed() throws Exception {
461461
hasEntry("elasticsearch.event.category", "api"),
462462
hasKey("elasticsearch.node.id"),
463463
hasKey("elasticsearch.node.name"),
464-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
464+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
465465
hasEntry("data_stream.namespace", "default"),
466466
hasEntry("data_stream.type", "logs"),
467467
hasKey("ecs.version"),
468468
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"),
469-
hasEntry("event.dataset", "deprecation.elasticsearch"),
469+
hasEntry("event.dataset", "elasticsearch.deprecation"),
470470
hasEntry("log.level", "WARN"),
471471
hasKey("log.logger"),
472472
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")
@@ -619,12 +619,12 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception {
619619
hasEntry("elasticsearch.event.category", "compatible_api"),
620620
hasKey("elasticsearch.node.id"),
621621
hasKey("elasticsearch.node.name"),
622-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
622+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
623623
hasEntry("data_stream.namespace", "default"),
624624
hasEntry("data_stream.type", "logs"),
625625
hasKey("ecs.version"),
626626
hasEntry(KEY_FIELD_NAME, "compatible_key"),
627-
hasEntry("event.dataset", "deprecation.elasticsearch"),
627+
hasEntry("event.dataset", "elasticsearch.deprecation"),
628628
hasEntry("log.level", "CRITICAL"),
629629
hasKey("log.logger"),
630630
hasEntry("message", "You are using a compatible API for this request")
@@ -637,12 +637,12 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception {
637637
hasEntry("elasticsearch.event.category", "compatible_api"),
638638
hasKey("elasticsearch.node.id"),
639639
hasKey("elasticsearch.node.name"),
640-
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
640+
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
641641
hasEntry("data_stream.namespace", "default"),
642642
hasEntry("data_stream.type", "logs"),
643643
hasKey("ecs.version"),
644644
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/compat_only"),
645-
hasEntry("event.dataset", "deprecation.elasticsearch"),
645+
hasEntry("event.dataset", "elasticsearch.deprecation"),
646646
hasEntry("log.level", "CRITICAL"),
647647
hasKey("log.logger"),
648648
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/logging/DeprecationIndexingComponent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private DeprecationIndexingComponent(
9191
final Configuration configuration = context.getConfiguration();
9292

9393
final EcsLayout ecsLayout = ECSJsonLayout.newBuilder()
94-
.setDataset("deprecation.elasticsearch")
94+
.setDataset("elasticsearch.deprecation")
9595
.setConfiguration(configuration)
9696
.build();
9797

0 commit comments

Comments
 (0)