Closed sophieyfang closed 3 years ago
permalink: https://link.calyptia.com/ax4
Looking at the filter that uses rewrite tag, the new emitted records will have the same tag syslog
, so it will continuosly matching the rewrite tool. Note that when rewrite_tag emits a record, this records go through all the beginning of the pipeline, so it's suggested that your new tag has a different prefix, e.g:
[FILTER]
Name rewrite_tag
Match default_pipeline.syslog
Rule $logName .* new.$logName false
Emitter_Storage.type filesystem
Emitter_Mem_Buf_Limit 10M
[FILTER]
Name modify
Match new.syslog
Remove logName
After going thru rewrite_tag
plugin the tag name is changed from default_pipeline.syslog
to syslog
. So why will it go thru rewrite_tag
plugin again?
The expected final log tag from client side shall be in syslog
andwindows_event_log
. Also we use those confs and they were working before.
sorry about that. I was able to reproduce it with a minimized config:
[SERVICE]
flush 1
log_level info
[INPUT]
name dummy
dummy {"key": "test"}
tag default_pipeline.syslog
[FILTER]
Name modify
Match default_pipeline.syslog
Add logName syslog
[FILTER]
name stdout
match *
[FILTER]
Name rewrite_tag
Match default_pipeline.syslog
Rule $logName .* $logName false
[FILTER]
Name modify
Match syslog
Remove logName
[OUTPUT]
name stdout
match syslog
the errors:
$ ../../build/bin/fluent-bit -c conf
Fluent Bit v1.7.0
* Copyright (C) 2019-2020 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2021/02/11 15:14:51] [ info] [engine] started (pid=1187409)
[2021/02/11 15:14:51] [ info] [storage] version=1.1.0, initializing...
[2021/02/11 15:14:51] [ info] [storage] in-memory
[2021/02/11 15:14:51] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/02/11 15:14:51] [ info] [sp] stream processor started
[2021/02/11 15:14:51] [error] [input chunk] no available chunk
[2021/02/11 15:14:52] [error] [input chunk] no available chunk
I looked at code in https://github.com/fluent/fluent-bit/tree/master/plugins/filter_rewrite_tag and https://github.com/fluent/fluent-bit/tree/master/plugins/filter_modify. It seems no change since last year.. maybe it's the order how those filters are executed got changed recently.. 🤷♀️
Thank you Eduardo. Much appreciated for picking up this bug!
this issue was generated by another PR.
@JeffLuoo can you help us to troubleshoot this issue ? this is a blocker for the release and was introduced on this commit:
https://github.com/fluent/fluent-bit/commit/44e9e9df79e55ba6f078849a20cff1fa06b27734
This is the line triggering the problem:
https://github.com/fluent/fluent-bit/blob/master/src/flb_input_chunk.c#L561
@edsiper I will take a look.
@sophieyfang I've pushed a temporal branch that reverts #2882
@JeffLuoo if you can get this sorted out would be awesome :)
adding @jlunavtgrad for visibility
Some update... After adding some printout to the code and I found that the new tag is not passed to the function https://github.com/fluent/fluent-bit/blob/e34f061396f95955af828049feaa0baedfb60a47/src/flb_routes_mask.c#L32
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2021/02/11 22:56:31] [ info] [engine] started (pid=3756777)
[2021/02/11 22:56:31] [ info] [storage] version=1.1.0, initializing...
[2021/02/11 22:56:31] [ info] [storage] in-memory
[2021/02/11 22:56:31] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/02/11 22:56:31] [ info] [sp] stream processor started
[2021/02/11 22:56:31] [ info] The tag now is default_pipeline.syslog
[2021/02/11 22:56:31] [ info] [input chunk] no matching route for input chunk '3756777-1613084191.882263195.flb' with tag 'default_pipeline.syslog'
[2021/02/11 22:56:31] [ info] flb_routes_mask_is_empty returns 1
[2021/02/11 22:56:31] [error] [input chunk] no available chunk
I'm not sure if my changes are the root cause. I backdated my build to Feb 1st, before my changes were merged, and I wasn't able to get tag rewriting to work.
FWIW, I think @JeffLuoo is on the point. The input plugin seems to be discarding data because it thinks there is no corresponding output plugin for these chunks.
Evidently it does not notice the existence of out_stackdriver
, who is listening to
the stream though filter_rewrite_tag
.
I posted a hot fix #3071 which essentially brings back the conditional statement that was removed here. Probably there may be a wiser fix, but I can confirm that this patch resolves the failure case @sophieyfang reported.
Fixed in #3071
We use three filters to tweak the log tag name for syslog for Linux and eventlog for Windows. I just found out that the whole source of the logs(syslog or eventlog) don't get ingested if those three filters are there. This conf was working before. I turned on the log_level to debug, still the only error message is "[2021/02/11 19:19:01] [error] [input chunk] no available chunk". However, removing those three filters in the conf bring back the logs..
Reproduce
Build agent from master branch(current:9c35c28f) or v1.7.0-rc5.
Use configuration (on any Linux distros, e.x. centos8 is the one i use):