elastic / elastic/logstash

Raise an Error for Duplicate Hash Keys in Plugin Configs

Open
#8,605 2 comments 0 reactions 0 assignees View on GitHub
breaking change v7.0.0-alpha1
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

Follow up to https://github.com/elastic/logstash/pull/8597

We want to stop supporting this:

```
foo => { "bar" => "hello" }
foo => { "baz" => "goodbye" }
```

which currently gets interpreted as:

```
foo => {
"bar" => "hello"
"baz" => "goodbye"
}
```

and instead, want to raise a config error when encountering a duplicate key in a plugin config.

Also as @jordansissel mentions below:

> [...] we should also add this to 6.x but instead of an error (as in 7.0) it logs a warning w/ how to fix the issue.

-------------

Note that this is supposed to only be merged to `7.x` (`master` as of the time of writing) not `6.x`.

Contributor guide

Open the contributing guide

Research direction

Review pull request #8597 and trace the plugin configuration parsing path it changes. Confirm where duplicate keys are currently combined, then define the 7.x behavior as a configuration error for repeated keys; the issue explicitly excludes 6.x. Verify the behavior with the relevant parser or configuration tests, though no test file is named here.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.