Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter_rewrite_tag: emit using decoder parameters #7311

Conversation

nokute78
Copy link
Collaborator

@nokute78 nokute78 commented May 4, 2023

This patch is to emit record using decoder parameters.
See also #7305 (review)


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • [N/A] Backport to latest stable release.

Configuration

[INPUT]
    name dummy

[FILTER]
    name rewrite_tag
    match dummy*
    Rule aa bb new_tag false

[OUTPUT]
    name stdout
    match *

Debug/Valgrind output

$ valgrind --leak-check=full bin/fluent-bit -c a.conf 
==25114== Memcheck, a memory error detector
==25114== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==25114== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==25114== Command: bin/fluent-bit -c a.conf
==25114== 
Fluent Bit v2.1.3
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/05/04 09:03:24] [ info] [fluent bit] version=2.1.3, commit=c7c6aebf69, pid=25114
[2023/05/04 09:03:24] [ info] [storage] ver=1.2.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/05/04 09:03:24] [ info] [cmetrics] version=0.6.1
[2023/05/04 09:03:24] [ info] [ctraces ] version=0.3.0
[2023/05/04 09:03:24] [ info] [input:dummy:dummy.0] initializing
[2023/05/04 09:03:24] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2023/05/04 09:03:25] [ info] [input:emitter:emitter_for_rewrite_tag.0] initializing
[2023/05/04 09:03:25] [ info] [input:emitter:emitter_for_rewrite_tag.0] storage_strategy='memory' (memory only)
[2023/05/04 09:03:25] [ info] [output:stdout:stdout.0] worker #0 started
[2023/05/04 09:03:25] [ info] [sp] stream processor started
[0] dummy.0: [[1683158606.065207974, {}], {"message"=>"dummy"}]
[0] dummy.0: [[1683158607.065530256, {}], {"message"=>"dummy"}]
^C[2023/05/04 09:03:28] [engine] caught signal (SIGINT)
[2023/05/04 09:03:28] [ warn] [engine] service will shutdown in max 5 seconds
[0] dummy.0: [[1683158608.033553902, {}], {"message"=>"dummy"}]
[2023/05/04 09:03:28] [ info] [input] pausing dummy.0
[2023/05/04 09:03:29] [ info] [engine] service has stopped (0 pending tasks)
[2023/05/04 09:03:29] [ info] [input] pausing dummy.0
[2023/05/04 09:03:29] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/05/04 09:03:29] [ info] [output:stdout:stdout.0] thread worker #0 stopped
==25114== 
==25114== HEAP SUMMARY:
==25114==     in use at exit: 0 bytes in 0 blocks
==25114==   total heap usage: 1,971 allocs, 1,971 frees, 1,581,267 bytes allocated
==25114== 
==25114== All heap blocks were freed -- no leaks are possible
==25114== 
==25114== For lists of detected and suppressed errors, rerun with: -s
==25114== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@nokute78 nokute78 temporarily deployed to pr May 4, 2023 00:04 — with GitHub Actions Inactive
@nokute78 nokute78 temporarily deployed to pr May 4, 2023 00:04 — with GitHub Actions Inactive
@nokute78 nokute78 temporarily deployed to pr May 4, 2023 00:04 — with GitHub Actions Inactive
@nokute78 nokute78 temporarily deployed to pr May 4, 2023 00:24 — with GitHub Actions Inactive
@leonardo-albertovich leonardo-albertovich merged commit 94e337a into fluent:master May 4, 2023
@nokute78 nokute78 deleted the rewrite_tag_emit_using_log_decoder branch May 4, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants