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

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

Open
nokute78 opened this issue Jan 21, 2022 · 0 comments
Open

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

nokute78 opened this issue Jan 21, 2022 · 0 comments

Comments

@nokute78
Copy link
Contributor

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>
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

1 participant