Skip to content

Commit

Permalink
filter_rewrite_tag: prevent to emit original record when in_emit pauses
Browse files Browse the repository at this point in the history
If in_emitter pauses before original input plugin pauses,
some records will emit even if keep option is disabled.
Since keep property is only used when emitting is success.

Signed-off-by: Takahiro Yamashita <[email protected]>
  • Loading branch information
nokute78 authored and edsiper committed Oct 27, 2021
1 parent f8727e9 commit 30e8a66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/filter_rewrite_tag/rewrite_tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static int cb_rewrite_tag_filter(const void *data, size_t bytes,
* - record with new tag was emitted and the rule says it must be preserved
* - record was not emitted
*/
if ((ret == FLB_TRUE && keep == FLB_TRUE) || ret == FLB_FALSE) {
if (keep == FLB_TRUE) {
msgpack_sbuffer_write(&mp_sbuf, (char *) data + pre, off - pre);
}

Expand Down

0 comments on commit 30e8a66

Please sign in to comment.