Skip to content

Not working add_metadata_from_env in logstash v5.1.1 #11

Description

@phirov

The configure option add_metadata_from_env is not working.

System info is here:

  • Version: logstash 5.1.1
  • Operating System: official docker image of logstash:5.1.1
  • Config File:
input {
    stdin { }
}

filter {
    environment {
        add_metadata_from_env => {
            "home1" => "HOME"
        }
        add_field => {
            "home2" => "${HOME}"
        }
    }
}

output {
    stdout {
        codec => rubydebug
    }
}
  • Sample Data:
Sending Logstash's logs to /var/log/logstash which is now configured via log4j2.properties
The stdin plugin is now waiting for input:
09:05:20.762 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>1, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>125}
09:05:20.770 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
09:05:20.845 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
aaaa
{
    "@timestamp" => 2017-02-14T09:05:24.998Z,
      "@version" => "1",
          "host" => "696a6caef712",
       "message" => "aaaa",
          "tags" => [],
         "home2" => "/root"
}

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