Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #13391 to 8.0: ECS on by default for Logstash 8, again #13416

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

yaauie
Copy link
Member

@yaauie yaauie commented Nov 17, 2021

Backport PR #13391 to 8.0 branch. Original message:

Release notes

[breaking] The pipeline.ecs_compatibility setting now defaults to v8, causing all plugins that implement an ECS compatibility mode to default to operating with ecs_compatibility => v8.

What does this PR do?

Effectively reverts #13080, making the default ECS compatibility mode v8 for Logstash 8, and adds INFO-level logging for each pipeline to indicate in which mode its plugins will be run.

Why is it important/What is the impact to the user?

This the final step of a large and ongoing effort to provide better support for the Elastic Common Schema, detailed in #11623. In #13080 we had back-tracked making the breaking change out of an abundance of caution, but have since decided to move forward with it.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

There are a number of plugins that ship with Logstash and have ECS modes, that do NOT yet have modes for v8. Because the scope of changes for v1->v8 is so small, I think that all of these can provide a v8 implementation that simply aliases the existing v1 implementation.

How to test this PR locally

bin/logstash -e ''
  • Observe an info-level log indicating that the pipeline is being run in ECS-compatibility mode.
  • Observe no deprecation log from the stdin input indicating that the default ecs_compatibility may change
  • Process one event, observe that the structure is ECS-compliant ([host][hostname])

Related issues

Resolves #11623
Reverts #13080

* ecs: report pipeline's ECS-compatibility with INFO at startup

Because the pipeline-level setting `pipeline.ecs_compatibility` affects the
default behaviour of nearly every plugin in the pipeline, an INFO-level log
message will provide useful hints, especially to our users who upgrade to
Logstash 8 without first reading the breaking changes docs.

For example, when we have two pipelines `old` and `new` whose `pipeline.ecs_compatibility` is `disabled` and `v8` respectively, we would get the following log messages:

> ~~~
> [2021-11-04T18:43:21,810][INFO ][logstash.javapipeline    ] Pipeline `old` is configured with `pipeline.ecs_compatibility: disabled` setting. All plugins in this pipeline will default to `ecs_compatibility => disabled` unless explicitly configured otherwise.
> [2021-11-04T18:43:21,817][INFO ][logstash.javapipeline    ] Pipeline `new` is configured with `pipeline.ecs_compatibility: v8` setting. All plugins in this pipeline will default to `ecs_compatibility => v8` unless explicitly configured otherwise.
> ~~~

* ecs: make v8 the default for 8.0

* ecs: `pipeline.ecs_compatibility` defaults to `v8`

Related: elastic#11623

* doc: temporarily remove deep link from breaking changes doc to fix build

(cherry picked from commit c3e498a)
Copy link
Contributor

@kares kares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested a few scenarios,
including ingestion to ES with defaults (output { elasticsearch {} }) - had the proper warning about ECS v8 N/A:

[WARN ][logstash.outputs.elasticsearch][main] Elasticsearch Output configured with `ecs_compatibility => v8`, which resolved to an UNRELEASED preview of version 8.0.0 of the Elastic Common Schema. Once ECS v8 and an updated release of this plugin are publicly available, you will need to update this plugin to resolve this warning.

@kares kares merged commit 042eb98 into elastic:8.0 Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants