tsaikd / gogstash

Logstash like, written in golang
MIT License
644 stars 106 forks source link

Add common filter logic add/remove tag/field #90

Closed horacimacias closed 5 years ago

horacimacias commented 5 years ago

I'm suggesting this change so all filters allow adding/removing tags and filters, without needing a specific filter for this operation

tsaikd commented 5 years ago

I prefer keep every component as simple as possible, but this is an open issue for discussion. Any other opinion?

horacimacias commented 5 years ago

The logic inside components will be the same as this common behaviour is implemented in a common/inherited method. The benefit of this common logic is that users of gogstash will not need "extra" components to only add/remove tags/fields. The complexity is the same; just that right now the logic is on a specific component and with this change it will be in a common place. As a side note, this is also how logstash does it; the amount of common logic is different but add/remove tags/fields is a common feature. For example see https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-common-options