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 <nokute78@gmail.com>
  • Loading branch information
nokute78 committed Oct 3, 2021
1 parent ea9cf22 commit e2b566e
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 @@ -398,7 +398,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 e2b566e

Please sign in to comment.