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

Remove event_api.tags.illegal for v9 #16461

Merged
merged 8 commits into from
Oct 15, 2024

Conversation

kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Sep 17, 2024

_Do Not Merge until we got approval from breaking changes committee _
This PR should not backport to 8.x

Release notes

Removed the --event_api.tags.illegal flag, which allowed setting non string values to the tags field. Since v9, such illegal assignments will fail, resulting in a _tagsparsefailure in the tags field, and the illegal value will be written to the _tags field.

What does this PR do?

The commit removes the --event_api.tags.illegal option which is added in #14822

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

This is a breaking change. User no longer be able to set event_api.tags.illegal to warn as a fallback to accept the illegal assignment of tags field.

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

  • run with --event_api.tags.illegal warn throws Unrecognised option
  • illegal assignment is written to _tags

How to test this PR locally

  1. bin/logstash -f /path/to/p.conf --event_api.tags.illegal warn should give Unrecognised option
  2. Happy case
input {
    generator {
      count=> 1
      message => '{"tags": ["a","b"] }'
      codec => json
    }
}

output {
    stdout {}
}

It is valid tags and should give no error

  1. Sad case
input {
    generator {
      count=> 1
      message => '{"tags": {"poison":true}}'
      codec => json
    }
}

output {
    stdout {}
}

It is invalid tags and should give _tagsparsefailure

Related issues

Use cases

Screenshots

Logs

@kaisecheng kaisecheng marked this pull request as ready for review September 17, 2024 21:52
@kaisecheng kaisecheng changed the title Remove warn option of event_api.tags.illegal Remove event_api.tags.illegal for v9 Oct 3, 2024
@kaisecheng
Copy link
Contributor Author

@mashhur this is ready for review

@kaisecheng kaisecheng mentioned this pull request Oct 14, 2024
6 tasks
Copy link
Contributor

@mashhurs mashhurs left a comment

Choose a reason for hiding this comment

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

LGTM!

import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: better to import specific classes rather than entire package. I think your IntelliJ (or dev tool) made this change.

Copy link

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@kaisecheng kaisecheng merged commit cb3b7c0 into elastic:main Oct 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove event_api.tags.illegal (default becomes locked to 'rename')
4 participants