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

timeout_label behaviour #84

Open
g3kr opened this issue Feb 5, 2020 · 1 comment
Open

timeout_label behaviour #84

g3kr opened this issue Feb 5, 2020 · 1 comment

Comments

@g3kr
Copy link

g3kr commented Feb 5, 2020

Problem

More than a problem. I am trying to understand and looking for recommendations on usingtimeout_label with fluent-plugin-concat

Steps to replicate

my current config


<source>
  @type forward
  @label @input
  port 24224
</source>

<label @input>
  <filter **>
    @type concat
    key log
    partial_key partial_message
    partial_value true
    separator ""
    timeout_label @splitlog
  </filter>
  <match **>
    @type relabel
    @label @NORMAL
  </match>
  </label>
  
<label @splitlog>
  <filter **>
    @type parser
    key_name log
    remove_key_name_field true
    reserve_data true
    <parse>
      @type "json"
    </parse>
  </filter>

  <filter **>
    @type parser
    key_name "message"
    reserve_data true
    remove_key_name_field true
    <parse>
      @type "json"
    </parse>
  </filter>

  <match **>
    @type relabel
    @label @NORMAL
  </match>
</label>

<label @NORMAL>
  <filter **>
    @type record_modifier
    <record>
    @timestamp Time.at(time).strftime('%Y-%m-%dT%H:%M:%S.%3N')}
    </record>
  </filter>

  <match **>
   @type stdout
  </match>

</label>

Expected Behavior

I want the messages that go through the concat plugin to timeout and when timeout event happens route them to a different label splitlog. currently timeout does not happen always and hence I don't have a means to send them to the splitlog label.

Is there a way I could achieve this? TIA.

@okkez
Copy link
Member

okkez commented May 30, 2020

You can use flush_interval parameter. It has the default value 60 seconds.
If you use Docker 19.03+, you can use followings:

<filter>
  @type concat
  key log
  use_partial_metadata true
  separator ""
</filter>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants