Skip to content

<parse> and <extract> sections are required for in_exec #388

@nokute78

Description

@nokute78

Describe the bug

I tested in_exec using latest master
Refer to document, <parse> and <extract> are not required.

However below configuration causes error since keys of <parse> is missing.
[error]: config error file="../b.conf" error_class=Fluent::ConfigError error="'keys' parameter is required"

$ bundle exec bin/fluentd  -c ../b.conf 
2022-01-22 07:53:01 +0900 [info]: parsing config file is succeeded path="../b.conf"
2022-01-22 07:53:01 +0900 [info]: gem 'fluentd' version '1.14.4'
2022-01-22 07:53:01 +0900 [error]: config error in:
<parse>
</parse>

2022-01-22 07:53:01 +0900 [error]: config error file="../b.conf" error_class=Fluent::ConfigError error="'keys' parameter is required"

Link to the problematic documentation

https://docs.fluentd.org/input/exec#less-than-parse-greater-than-section
https://docs.fluentd.org/input/exec#less-than-extract-greater-than-section

Expected explanation

In my understanding, <parse> and <extract> sections are required.
I think below is minimum configuration for in_exec.

<source>
  @type exec
  command echo -n '{"foo": "bar", "tag":"aaa"}'
  <parse>
    @type json
  </parse>
  <extract>
    tag_key tag
  </extract>
</source>

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

Additional context

Below is error report if we execute without <extract> section.
So I think <extract> section are also required.

$ bundle exec bin/fluentd  -c ../b.conf 
2022-01-22 07:57:07 +0900 [info]: parsing config file is succeeded path="../b.conf"
2022-01-22 07:57:07 +0900 [info]: gem 'fluentd' version '1.14.4'
2022-01-22 07:57:07 +0900 [error]: config error file="../b.conf" error_class=Fluent::ConfigError error="'tag' or 'tag_key' option is required on exec input"
<source>
  @type exec
  command echo -n '{"foo": "bar", "tag":"aaa"}'
  <parse>
    @type json
  </parse>
</source>

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions