@@ -92,14 +92,15 @@ public void testDeprecatedMessageWithoutXOpaqueId() throws IOException {
92
92
93
93
assertThat (jsonLogs , contains (
94
94
allOf (
95
- hasEntry ("event.dataset" , "elasticsearch. deprecation" ),
95
+ hasEntry ("event.dataset" , "deprecation.elasticsearch " ),
96
96
hasEntry ("log.level" , "DEPRECATION" ),
97
97
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
98
98
hasEntry ("elasticsearch.cluster.name" , "elasticsearch" ),
99
99
hasEntry ("elasticsearch.node.name" , "sample-name" ),
100
100
hasEntry ("message" , "deprecated message1" ),
101
101
hasEntry ("data_stream.type" , "logs" ),
102
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
102
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
103
+ hasEntry ("data_stream.namespace" , "default" ),
103
104
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
104
105
hasEntry (DeprecatedMessage .KEY_FIELD_NAME , "a key" ),
105
106
not (hasKey (DeprecatedMessage .X_OPAQUE_ID_FIELD_NAME )),
@@ -131,8 +132,9 @@ public void testCompatibleLog() throws Exception {
131
132
contains (
132
133
allOf (
133
134
hasEntry ("log.level" , "DEPRECATION" ),
134
- hasEntry ("event.dataset" , "elasticsearch.deprecation" ),
135
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
135
+ hasEntry ("event.dataset" , "deprecation.elasticsearch" ),
136
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
137
+ hasEntry ("data_stream.namespace" , "default" ),
136
138
hasEntry ("data_stream.type" , "logs" ),
137
139
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
138
140
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
@@ -146,8 +148,9 @@ public void testCompatibleLog() throws Exception {
146
148
allOf (
147
149
hasEntry ("log.level" , "DEPRECATION" ),
148
150
// event.dataset and data_stream.dataset have to be the same across the data stream
149
- hasEntry ("event.dataset" , "elasticsearch.deprecation" ),
150
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
151
+ hasEntry ("event.dataset" , "deprecation.elasticsearch" ),
152
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
153
+ hasEntry ("data_stream.namespace" , "default" ),
151
154
hasEntry ("data_stream.type" , "logs" ),
152
155
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
153
156
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
@@ -165,6 +168,7 @@ public void testCompatibleLog() throws Exception {
165
168
assertWarnings ("deprecated message1" , "compatible API message" );
166
169
});
167
170
}
171
+
168
172
public void testParseFieldEmittingDeprecatedLogs () throws Exception {
169
173
withThreadContext (threadContext -> {
170
174
threadContext .putHeader (Task .X_OPAQUE_ID , "someId" );
@@ -193,8 +197,9 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
193
197
// deprecation log for field deprecated_name
194
198
allOf (
195
199
hasEntry ("log.level" , "DEPRECATION" ),
196
- hasEntry ("event.dataset" , "elasticsearch.deprecation" ),
197
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
200
+ hasEntry ("event.dataset" , "deprecation.elasticsearch" ),
201
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
202
+ hasEntry ("data_stream.namespace" , "default" ),
198
203
hasEntry ("data_stream.type" , "logs" ),
199
204
hasEntry ("log.logger" , "org.elasticsearch.deprecation.common.ParseField" ),
200
205
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
@@ -208,8 +213,9 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
208
213
// deprecation log for field deprecated_name2 (note it is not being throttled)
209
214
allOf (
210
215
hasEntry ("log.level" , "DEPRECATION" ),
211
- hasEntry ("event.dataset" , "elasticsearch.deprecation" ),
212
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
216
+ hasEntry ("event.dataset" , "deprecation.elasticsearch" ),
217
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
218
+ hasEntry ("data_stream.namespace" , "default" ),
213
219
hasEntry ("data_stream.type" , "logs" ),
214
220
hasEntry ("log.logger" , "org.elasticsearch.deprecation.common.ParseField" ),
215
221
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
@@ -220,11 +226,12 @@ public void testParseFieldEmittingDeprecatedLogs() throws Exception {
220
226
hasEntry (DeprecatedMessage .X_OPAQUE_ID_FIELD_NAME , "someId" ),
221
227
hasEntry ("elasticsearch.event.category" , "api" )
222
228
),
223
- //compatible log line
229
+ // compatible log line
224
230
allOf (
225
231
hasEntry ("log.level" , "DEPRECATION" ),
226
- hasEntry ("event.dataset" , "elasticsearch.deprecation" ),
227
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
232
+ hasEntry ("event.dataset" , "deprecation.elasticsearch" ),
233
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
234
+ hasEntry ("data_stream.namespace" , "default" ),
228
235
hasEntry ("data_stream.type" , "logs" ),
229
236
hasEntry ("log.logger" , "org.elasticsearch.deprecation.common.ParseField" ),
230
237
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
@@ -263,14 +270,15 @@ public void testDeprecatedMessage() throws Exception {
263
270
jsonLogs ,
264
271
contains (
265
272
allOf (
266
- hasEntry ("event.dataset" , "elasticsearch. deprecation" ),
273
+ hasEntry ("event.dataset" , "deprecation.elasticsearch " ),
267
274
hasEntry ("log.level" , "DEPRECATION" ),
268
275
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
269
276
hasEntry ("elasticsearch.cluster.name" , "elasticsearch" ),
270
277
hasEntry ("elasticsearch.node.name" , "sample-name" ),
271
278
hasEntry ("message" , "deprecated message1" ),
272
279
hasEntry ("data_stream.type" , "logs" ),
273
- hasEntry ("data_stream.dataset" , "elasticsearch.deprecation" ),
280
+ hasEntry ("data_stream.dataset" , "deprecation.elasticsearch" ),
281
+ hasEntry ("data_stream.namespace" , "default" ),
274
282
hasEntry ("ecs.version" , DeprecatedMessage .ECS_VERSION ),
275
283
hasEntry (DeprecatedMessage .KEY_FIELD_NAME , "someKey" ),
276
284
hasEntry (DeprecatedMessage .X_OPAQUE_ID_FIELD_NAME , "someId" ),
@@ -422,7 +430,6 @@ public void testStacktrace() throws IOException {
422
430
}
423
431
}
424
432
425
-
426
433
public void testJsonInStacktraceMessageIsNotSplitted () throws IOException {
427
434
final Logger testLogger = LogManager .getLogger ("test" );
428
435
@@ -454,7 +461,6 @@ public void testJsonInStacktraceMessageIsNotSplitted() throws IOException {
454
461
}
455
462
}
456
463
457
-
458
464
public void testDuplicateLogMessages () throws Exception {
459
465
final DeprecationLogger deprecationLogger = DeprecationLogger .getLogger ("org.elasticsearch.test" );
460
466
@@ -473,7 +479,7 @@ public void testDuplicateLogMessages() throws Exception {
473
479
474
480
assertThat (jsonLogs , contains (
475
481
allOf (
476
- hasEntry ("event.dataset" , "elasticsearch. deprecation" ),
482
+ hasEntry ("event.dataset" , "deprecation.elasticsearch " ),
477
483
hasEntry ("log.level" , "DEPRECATION" ),
478
484
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
479
485
hasEntry ("elasticsearch.cluster.name" , "elasticsearch" ),
@@ -505,7 +511,7 @@ public void testDuplicateLogMessages() throws Exception {
505
511
jsonLogs ,
506
512
contains (
507
513
allOf (
508
- hasEntry ("event.dataset" , "elasticsearch. deprecation" ),
514
+ hasEntry ("event.dataset" , "deprecation.elasticsearch " ),
509
515
hasEntry ("log.level" , "DEPRECATION" ),
510
516
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
511
517
hasEntry ("elasticsearch.cluster.name" , "elasticsearch" ),
@@ -515,7 +521,7 @@ public void testDuplicateLogMessages() throws Exception {
515
521
hasEntry ("elasticsearch.event.category" , "other" )
516
522
),
517
523
allOf (
518
- hasEntry ("event.dataset" , "elasticsearch. deprecation" ),
524
+ hasEntry ("event.dataset" , "deprecation.elasticsearch " ),
519
525
hasEntry ("log.level" , "DEPRECATION" ),
520
526
hasEntry ("log.logger" , "org.elasticsearch.deprecation.test" ),
521
527
hasEntry ("elasticsearch.cluster.name" , "elasticsearch" ),
@@ -555,7 +561,6 @@ private void setupLogging(final String config, final Settings settings) throws I
555
561
LogConfigurator .configure (environment );
556
562
}
557
563
558
-
559
564
private Matcher <JsonLogLine > logLine (String type , Level level , String nodeName , String component , String message ) {
560
565
return logLine (mapOfParamsToCheck (type , level , nodeName , component , message ));
561
566
}
0 commit comments