diff --git a/docs/changelog/125606.yaml b/docs/changelog/125606.yaml
new file mode 100644
index 0000000000000..d647464892d92
--- /dev/null
+++ b/docs/changelog/125606.yaml
@@ -0,0 +1,17 @@
+pr: 125606
+summary: Rename deprecation index template
+area: Infra/Logging
+type: breaking
+issues:
+ - 125445
+breaking:
+ title: Rename deprecation index template
+ area: Logging
+ details: The deprecation datastream contains log entries for deprecations that
+ occured while Elasticsearch is running. The deprecation log entries had a
+ mismatch in their dataset name. In order to avoid changing the dataset
+ name in the existing datastream, a new datastream now exists.
+ impact: If querying for deprecations previously using the
+ `.logs-deprecation.elasticsearch-default` datastream, you should now use the
+ `.logs-elasticsearch.deprecation-default` datastream.
+ notable: false
diff --git a/x-pack/plugin/core/template-resources/src/main/resources/deprecation/deprecation-indexing-template.json b/x-pack/plugin/core/template-resources/src/main/resources/deprecation/deprecation-indexing-template.json
index 3dc97ba50a7b8..fa7a0ba972059 100644
--- a/x-pack/plugin/core/template-resources/src/main/resources/deprecation/deprecation-indexing-template.json
+++ b/x-pack/plugin/core/template-resources/src/main/resources/deprecation/deprecation-indexing-template.json
@@ -1,5 +1,5 @@
{
- "index_patterns": [".logs-deprecation.*"],
+ "index_patterns": ["${xpack.deprecation.indexing.template.pattern}"],
"priority": 1000,
"data_stream": {
"hidden": true
@@ -13,5 +13,6 @@
"description": "default template for Stack deprecation logs index template installed by x-pack",
"managed": true
},
+ "deprecated": ${xpack.deprecation.indexing.template.deprecated},
"version": ${xpack.deprecation.indexing.template.version}
}
diff --git a/x-pack/plugin/deprecation/qa/common/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationTestUtils.java b/x-pack/plugin/deprecation/qa/common/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationTestUtils.java
index a9018c9f80a87..74c3f5b56a0b1 100644
--- a/x-pack/plugin/deprecation/qa/common/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationTestUtils.java
+++ b/x-pack/plugin/deprecation/qa/common/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationTestUtils.java
@@ -23,7 +23,7 @@ public class DeprecationTestUtils {
/**
* Same as DeprecationIndexingAppender#DEPRECATION_MESSAGES_DATA_STREAM, but that class isn't visible from here.
*/
- public static final String DATA_STREAM_NAME = ".logs-deprecation.elasticsearch-default";
+ public static final String DATA_STREAM_NAME = ".logs-elasticsearch.deprecation-default";
static List