Skip to content

in_exec json streams does not work as expected #609

@serbaut

Description

@serbaut

ruby-yajl reads 8k from the input stream before parsing so input is delayed until the buffer is full (which can take forever if no new input is generated).

This can be reproduced with the following config:

<source>
  type exec
  format tsv
  command while sleep 1; do date; done
  keys tsv_date
  tag all
</source>

<source>
  type exec
  format json
  command while sleep 1; do echo '{"json_date": "'$(date)'"}'; done
  tag all
</source>

<match all>
  type stdout
</match>

tsv_date is emitted each time but json_date is not emitted until the buffer is full (~5 minutes in this case).

I have created a workaround serbaut@c99bcf4 that parses line by line but in the end ruby-yajl has to be fixed so is parses one json document at a time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request*Deprecated Label* Use enhancement label in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions