write developers doc or blog about Event initialization in codecs/input plugins
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
I want to document for developers the different strategies when initializing/building a new `LogStash::Event`. This usually happens in a codec `decode` method but codec-less input plugins can also do that.
There are basically 2 ways:
- using the event field-reference syntax, for example:
``` ruby
event = LogStash::Event.new
event["[foo][bar]"] = "baz"
```
- using a hash
``` ruby
data = {
"foo" => {
"bar" => "baz"
}
}
event = LogStash::Event(data)
```
A quick benchmark for this shows that using a hash is more than twice as fast as using the field-reference syntax which is really meant for event manipulation from the logstash config.
The reason for this is that there is extra logic required to parse the field reference string as opposed to directly manipulating a `Hash`.
Contributor guide
Assessment
This issue has not been assessed yet.