elastic / elastic/logstash

new v3.0 Event API for timestamp initialization and coercion

Open
#4,328 2 comments 0 reactions 0 assignees View on GitHub
code cleanup
Dominant language
Java
Stars
14.9k
Forks
3.5k
Avg merge
1d 4h
Merged PRs (30d)
88

Description

This follows up on the idea in #4293

Some plugins might need to re-inject a timestamp and currently the `Event` timestamp [initialization and coercion](https://github.com/elastic/logstash/blob/c2ea4a7a6eedee46fb7d169773b150cc44c78713/logstash-core-event/lib/logstash/event.rb#L250-L266) is not exposed.

As an example, the json filter would really benefit this since it is actually reimplementing the timestamp initialization code, see https://github.com/logstash-plugins/logstash-filter-json/pull/18

At this point I am not sure if we should add a method in the `Event` or in `Timestamp` for this but either way we should make the timestamp initialization a public API and DRY the Event and the json filter.

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.