Skip to content

When using ConfigStringLoader, a default stdout can be added out of nowhere #19266

Description

@lucabelluccini

In case someone uses the following config in pipeline.yml:

- pipeline.id: "demo"
  pipeline.ecs_compatibility: disabled
  pipeline.workers: 3
  pipeline.batch.size: 5
  config.string: |
    input {
      generator {
        lines => [
          '{"hello": "world"}'
        ]
        count => 1
      }
    }

    filter
    {
      json {
        source => "message"
        remove_field => [ "message" ]
      }

    output
    {
      file {
        path => "/tmp/somefile.ndjson"
        codec => json_lines
      }
    }

Note the:

output
{
    ...

Then, a default stdout output is added.

This is confusing as this behavior is not documented.

Possible solutions:

  1. Make the regex
    OUTPUT_BLOCK_RE = /output *{/
    match also newlines or spaces between output and {
  2. Log a WARN if the default output is added

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