elastic / elastic/logstash

Logstash config and the possibility of repeating the options in the plugin block

Open
#6,747 0 comments 0 reactions 0 assignees View on GitHub
breaking change config syntax LIR
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
19h 14m
Merged PRs (30d)
63

Description

This issue or feature was originally reported by @tsouza

The current Logstash syntax parsing allows you to create this code when the plugin options are of type `array`:

```
input
{
file
{
path => "/opt/elk/data/syslogs/1.log"
path => "/opt/elk/data/syslogs/2.log"
path => "/opt/elk/data/syslogs/3.log"
path => "/opt/elk/data/syslogs/4.log"
path => "/opt/elk/data/syslogs/5.log"
path => "/opt/elk/data/syslogs/6.log"
path => "/opt/elk/data/syslogs/7.log"

}
}
```

Inside the plugin, the content of the `@path` variable will be an array containing all the different paths.

```ruby
["/opt/elk/data/syslogs/1.log" , "/opt/elk/data/syslogs/2.log" , "/opt/elk/data/syslogs/3.log" , "/opt/elk/data/syslogs/4.log" , "/opt/elk/data/syslogs/5.log" , "/opt/elk/data/syslogs/6.log" , "/opt/elk/data/syslogs/7.log"
```

After discussing with @andrewvc we know that new `LIR` feature doesn't support that use case and we think we should not support that syntax going forward in 6.0.
I do not believe that we ever exposed that syntax in our documentation and this could create other problems if we ever want to support another format like JSON or YAML.

Also, it feels like a hack since in our documentation we never mention that you can use multiple time the same plugin option.

Thoughts on not supporting and deprecating that syntax?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.