[Plugin design] Streamline event submission by an input plugin
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
Currently all input plugins contains _more or less_ the following lines
```
event["host"] = @host # from Socket.gethostname
decorate(event)
[...]
queue << event
```
**decorate** is handling the add_field/add_tag and with #2390 it could use sprintf syntax and already manipulate event fields set by the input plugin, so it should be enforced that decorate() is called after the event is filled by the specific input.
The idea would be to DRY this into inputs/base.rb, it would avoid plugin implementor to forget or misplace the call to decorate()
Thoughts ?
Here is the list of inputs not complying with the proposed rule
- exec
- file
- ganglia
- generator
- heroku
- irc
- kafka
- log4j
- lumberjack
- relp
- s3
- snmptrap
- sqlite
- sqs
- stdin
- syslog
- udp
- unix
- varnishlog
- wmi
- xmpp
- zenoss
Contributor guide
Assessment
This issue has not been assessed yet.