Skip to content

Commit

Permalink
minor updates for user-agent ecs for 6.7
Browse files Browse the repository at this point in the history
PR elastic#38757 changed 7.0 user-agent behavior for the ecs flag
to more closely resemble 6.7. This commit updates the forward
looking comments and deprecation notices to be more accurate
now that this flag will not be removed until 8.0

related elastic#38757
  • Loading branch information
jakelandis committed Feb 21, 2019
1 parent a4485f2 commit 80bbc85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public IngestDocument execute(IngestDocument ingestDocument) {
}
}
} else {
// Deprecated format, removed in 7.0
// Deprecated format, removed in 8.0
for (Property property : this.properties) {
switch (property) {
case NAME:
Expand Down Expand Up @@ -316,7 +316,7 @@ public UserAgentProcessor create(Map<String, Processor.Factory> factories, Strin

if (useECS == false) {
deprecationLogger.deprecated("setting [ecs] to false for non-common schema " +
"format is deprecated and will be removed in 7.0, set to true to use the non-deprecated format");
"format is deprecated and will be removed in 8.0, set to true to use the non-deprecated format");
}

return new UserAgentProcessor(processorTag, field, targetField, parser, properties, ignoreMissing, useECS);
Expand All @@ -326,12 +326,12 @@ public UserAgentProcessor create(Map<String, Processor.Factory> factories, Strin
enum Property {

NAME,
// Deprecated in 6.7 (superceded by VERSION), to be removed in 7.0
// Deprecated in 6.7 (superceded by VERSION), to be removed in 8.0
@Deprecated MAJOR,
@Deprecated MINOR,
@Deprecated PATCH,
OS,
// Deprecated in 6.7 (superceded by just using OS), to be removed in 7.0
// Deprecated in 6.7 (superceded by just using OS), to be removed in 8.0
@Deprecated OS_NAME,
@Deprecated OS_MAJOR,
@Deprecated OS_MINOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ static DeprecationIssue checkUserAgentPipelines(ClusterState state) {
.filter(Objects::nonNull)
.filter(processor -> processor.containsKey("user_agent"))
.map(processor -> processor.get("user_agent"))
.anyMatch(processorConfig ->
false == ConfigurationUtils.readBooleanProperty(null, null, processorConfig, "ecs", false));
.anyMatch(processorConfig -> processorConfig.containsKey("ecs") == false);
})
.map(PipelineConfiguration::getId)
.sorted() // Make the warning consistent for testing purposes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void testUserAgentEcsCheck() {
"User-Agent ingest plugin will use ECS-formatted output",
"https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-7.0.html" +
"#ingest-user-agent-ecs-always",
"Ingest pipelines [ecs_false, ecs_null] will change to using ECS output format in 7.0");
"Ingest pipelines [ecs_null] will change to using ECS output format in 7.0");
assertEquals(singletonList(expected), issues);
}
}

0 comments on commit 80bbc85

Please sign in to comment.