Comments (5)
If dispatch the message when timeout occurred, we may get broken incomplete message.
It is very hard to process them properly, I think.
You can use timeout_label
to handle timeout events same as normal events.
<filter docker.*>
@type concat
...
timeout_label @TIMEOUT
</filter>
<label @TIMEOUT>
<match docker.*>
@type stdout
</match>
</label>
<match docker.*>
@type stdout
</match>
I cannot detect that next chain is filter plugin or output plugin in timeout context.
from fluent-plugin-concat.
Hmmmm... true I'll try to use that
After concat I have this config
<match **>
type copy
<store>
type elasticsearch
host elasticsearch
port 9200
logstash_format true
</store>
<store>
type grepcounter
count_interval 30
input_key log
regexp ERROR
threshold 1
delimiter \n\n
add_tag_prefix notification.error
</store>
</match>
I tried to use multiline_end_regexp
but most the times the end of a multline log is the begging of a new one... for exemple: setting "flush_interval 5" and "disable_timeout true" the user would have the assumption no other log came, so keep on (even knowing the risk of broken log)... This option should also disable the warning in fluentd log
I'm not sure (to be honest it's my first time using fluentd)... but using timeout_label
the config above should be copied in a ? I mean... or is there anyway to reference instead of Ctrl C then V?
from fluent-plugin-concat.
You can omit multiline_end_regexp
if you don't know that the end line of logs.
You must specify multiline_start_regexp
only.
For example,
<fileter docker.*>
@type concat
key message
multi_line_start_regxp /^Start/
flush_interval 6000 # very very long flush interval
</filter>
This works as followings:
Start
starts multiline logs- Concatenate any lines to buffer until next
Start
- Get next
Start
, flush buffer before thisStart
- Start new buffer and concatenate any lines to buffer until next
Start
📝 If you cannot get next Start
, this plugin cannot flush buffer forever (until flush_interval).
I'm not sure (to be honest it's my first time using fluentd)... but using timeout_label the config above should be copied in a ? I mean... or is there anyway to reference instead of Ctrl C then V?
Yes. You need to copy and paste, if you want same behavior for normal and timeout.
I know this is annoying to maintain fluentd configuration.
from fluent-plugin-concat.
Sure... I got the idea :D
Gonna close this issue
from fluent-plugin-concat.
@okkez The copy paste can be avoided by using the relabel plugin, as follows:
<filter **>
@type concat
key "message"
multiline_start_regexp "/^Start/"
flush_interval 5
timeout_label "@LASTLINE"
</filter>
<match **>
@type relabel
@label @NORMAL
</match>
<label @LASTLINE>
<match **>
@type relabel
@label @NORMAL
</match>
</label>
<label @NORMAL>
<match **>
@type stdout
</match>
</label>
from fluent-plugin-concat.
Related Issues (20)
- Concat containerd/docker output in the same config HOT 3
- What does Timeout flush exactly mean ? HOT 5
- concat lose last log line when it is a single line HOT 8
- Concatenating cri logs configError: Either n_lines, multiline_start_regexp, multiline_end_regexp, partial_key or use_partial_metadata is required HOT 1
- How to concat messages handled by timeout_label
- error_class=Fluent::Plugin::ConcatFilter::TimeoutError error="Timeout flush: kernel:default" location=nil tag="kernel" HOT 1
- Concatenate various fields
- Unknown filter plugin 'concat' [fluentd1.3.3 concat2.5.0] HOT 2
- Allow ruby expressions in plugin fields
- using the concat plugin with CRI logs ends up deleting the stream key from the record HOT 1
- process_partial_cri error="undefined method `split' for nil:NilClass" HOT 2
- Java multi-line logs merge into one line HOT 1
- separator not working for pretty json HOT 2
- Encoding Compatibility Error
- Concat problem on kubernetes with message with \n HOT 3
- emit transaction failed: error_class=NoMethodError error="undefined method `key?' for \"\":String" HOT 1
- Got "invalid byte sequence in UTF-8" error when use concat plugin HOT 6
- timeout flush and loss log HOT 4
- disable filter chain optimization because [Fluent::Plugin::ConcatFilter] uses filter_stream method HOT 1
- Can this handle multiline and non-multiline logs? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-plugin-concat.