Skip to content

Commit

Permalink
Revert "Deprecation dataset value changed to elasticsearch.deprecation (
Browse files Browse the repository at this point in the history
#83254)" (#87837)

This reverts commit bb06fac.
relates #83251
  • Loading branch information
pgomulka authored Jun 20, 2022
1 parent 93bf468 commit 3739e4b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 42 deletions.
2 changes: 1 addition & 1 deletion distribution/src/config/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ appender.deprecation_rolling.name = deprecation_rolling
appender.deprecation_rolling.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation.json
appender.deprecation_rolling.layout.type = ECSJsonLayout
# Intentionally follows a different pattern to above
appender.deprecation_rolling.layout.dataset = elasticsearch.deprecation
appender.deprecation_rolling.layout.dataset = deprecation.elasticsearch
appender.deprecation_rolling.filter.rate_limit.type = RateLimitingFilter

appender.deprecation_rolling.filePattern = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecation-%i.json.gz
Expand Down
6 changes: 0 additions & 6 deletions docs/changelog/83254.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException {
jsonLogs,
contains(
allOf(
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
hasEntry("elasticsearch.node.name", "sample-name"),
hasEntry("message", "deprecated message1"),
hasEntry("data_stream.type", "logs"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasKey("ecs.version"),
hasEntry(DeprecatedMessage.KEY_FIELD_NAME, "a key"),
Expand Down Expand Up @@ -167,8 +167,8 @@ public void testCompatibleLog() throws Exception {
contains(
allOf(
hasEntry("log.level", "CRITICAL"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
Expand All @@ -185,8 +185,8 @@ public void testCompatibleLog() throws Exception {
allOf(
hasEntry("log.level", "CRITICAL"),
// event.dataset and data_stream.dataset have to be the same across the data stream
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
Expand Down Expand Up @@ -239,8 +239,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
// deprecation log for field deprecated_name
allOf(
hasEntry("log.level", "WARN"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
Expand All @@ -257,8 +257,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
// deprecation log for field deprecated_name2 (note it is not being throttled)
allOf(
hasEntry("log.level", "WARN"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
Expand All @@ -275,8 +275,8 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
// compatible log line
allOf(
hasEntry("log.level", "CRITICAL"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasEntry("log.logger", "org.elasticsearch.deprecation.xcontent.ParseField"),
Expand Down Expand Up @@ -326,14 +326,14 @@ public void testDeprecatedMessage() throws Exception {
jsonLogs,
contains(
allOf(
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "WARN"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
hasEntry("elasticsearch.node.name", "sample-name"),
hasEntry("message", "deprecated message1"),
hasEntry("data_stream.type", "logs"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasKey("ecs.version"),
hasEntry(DeprecatedMessage.KEY_FIELD_NAME, "someKey"),
Expand Down Expand Up @@ -578,7 +578,7 @@ public void testDuplicateLogMessages() throws Exception {
jsonLogs,
contains(
allOf(
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
Expand Down Expand Up @@ -611,7 +611,7 @@ public void testDuplicateLogMessages() throws Exception {
jsonLogs,
contains(
allOf(
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
Expand All @@ -621,7 +621,7 @@ public void testDuplicateLogMessages() throws Exception {
hasEntry("elasticsearch.event.category", "other")
),
allOf(
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ appender.deprecated.name = deprecated
appender.deprecated.fileName = ${sys:es.logs.base_path}${sys:file.separator}${sys:es.logs.cluster_name}_deprecated.json
# Intentionally follows a different pattern to above
appender.deprecated.layout.type = ECSJsonLayout
appender.deprecated.layout.dataset = elasticsearch.deprecation
appender.deprecated.layout.dataset = deprecation.elasticsearch
appender.deprecated.filter.rate_limit.type = RateLimitingFilter

appender.deprecatedconsole.type = Console
appender.deprecatedconsole.name = deprecatedconsole
appender.deprecatedconsole.layout.type = ECSJsonLayout
# Intentionally follows a different pattern to above
appender.deprecatedconsole.layout.dataset = elasticsearch.deprecation
appender.deprecatedconsole.layout.dataset = deprecation.elasticsearch
appender.deprecatedconsole.filter.rate_limit.type = RateLimitingFilter


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static ESLogMessage getEsLogMessage(
String messagePattern,
Object[] args
) {
ESLogMessage esLogMessage = new ESLogMessage(messagePattern, args).field("data_stream.dataset", "elasticsearch.deprecation")
ESLogMessage esLogMessage = new ESLogMessage(messagePattern, args).field("data_stream.dataset", "deprecation.elasticsearch")
.field("data_stream.type", "logs")
.field("data_stream.namespace", "default")
.field(KEY_FIELD_NAME, key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "settings"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_settings"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "WARN"),
hasKey("log.logger"),
hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead")
Expand All @@ -438,12 +438,12 @@ public void testDeprecationMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "api"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "WARN"),
hasKey("log.logger"),
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")
Expand Down Expand Up @@ -490,12 +490,12 @@ public void testDeprecationCriticalWarnMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "settings"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_critical_settings"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasKey("log.logger"),
hasEntry("message", "[deprecated_settings] usage is deprecated. use [settings] instead")
Expand Down Expand Up @@ -542,12 +542,12 @@ public void testDeprecationWarnMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "settings"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_warn_settings"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "WARN"),
hasKey("log.logger"),
hasEntry("message", "[deprecated_warn_settings] usage is deprecated but won't be breaking in next version")
Expand All @@ -560,12 +560,12 @@ public void testDeprecationWarnMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "api"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/deprecated_settings"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "WARN"),
hasKey("log.logger"),
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")
Expand Down Expand Up @@ -624,12 +624,12 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "compatible_api"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "compatible_key"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasKey("log.logger"),
hasEntry("message", "You are using a compatible API for this request")
Expand All @@ -642,12 +642,12 @@ public void testCompatibleMessagesCanBeIndexed() throws Exception {
hasEntry("elasticsearch.event.category", "compatible_api"),
hasKey("elasticsearch.node.id"),
hasKey("elasticsearch.node.name"),
hasEntry("data_stream.dataset", "elasticsearch.deprecation"),
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
hasEntry("data_stream.namespace", "default"),
hasEntry("data_stream.type", "logs"),
hasKey("ecs.version"),
hasEntry(KEY_FIELD_NAME, "deprecated_route_GET_/_test_cluster/compat_only"),
hasEntry("event.dataset", "elasticsearch.deprecation"),
hasEntry("event.dataset", "deprecation.elasticsearch"),
hasEntry("log.level", "CRITICAL"),
hasKey("log.logger"),
hasEntry("message", "[/_test_cluster/deprecated_settings] exists for deprecated tests")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private DeprecationIndexingComponent(
final Configuration configuration = context.getConfiguration();

final EcsLayout ecsLayout = ECSJsonLayout.newBuilder()
.setDataset("elasticsearch.deprecation")
.setDataset("deprecation.elasticsearch")
.setConfiguration(configuration)
.build();

Expand Down

0 comments on commit 3739e4b

Please sign in to comment.