Skip to content

Commit

Permalink
minor updates for user-agent ecs for 6.7 (#39213)
Browse files Browse the repository at this point in the history
PR #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 #38757
  • Loading branch information
jakelandis authored Feb 21, 2019
1 parent e73a127 commit c4d2ce9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 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 @@ -90,7 +90,7 @@

- do:
warnings:
- "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"
- "setting [ecs] to false for non-common schema format is deprecated and will be removed in 8.0, set to true to use the non-deprecated format"
- "the [os_major] property is deprecated for the user-agent processor"
ingest.put_pipeline:
id: "my_pipeline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.ingest.ConfigurationUtils;
import org.elasticsearch.ingest.IngestService;
import org.elasticsearch.ingest.PipelineConfiguration;
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
Expand Down Expand Up @@ -78,8 +77,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 All @@ -89,7 +87,7 @@ static DeprecationIssue checkUserAgentPipelines(ClusterState state) {
"User-Agent ingest plugin will use ECS-formatted output",
"https://www.elastic.co/guide/en/elasticsearch/reference/7.0/breaking-changes-7.0.html" +
"#ingest-user-agent-ecs-always",
"Ingest pipelines " + pipelinesWithDeprecatedEcsConfig + " will change to using ECS output format in 7.0");
"Ingest pipelines " + pipelinesWithDeprecatedEcsConfig + " will change to using ECS output format by default in 7.0");
}
return null;

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/7.0/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 by default in 7.0");
assertEquals(singletonList(expected), issues);
}
}

0 comments on commit c4d2ce9

Please sign in to comment.