Cannot access @metadata of dead_letter_queue in 7.6.0

dead_letter_queue {
path => "/usr/share/logstash/data/dead_letter_queue/"
pipeline_id => "main"
commit_offsets => true
}

Trying to do stdout { codec => rubycodec { metadata => true } fails logstash from starting:

│ logstash [2020-02-27T12:35:48,091][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [A-Za-z0-9_-], [ \t\r\ │
│ \n], "#", "{", [A-Za-z0-9_], "}" at line 3, column 23 (byte 44) after output {\n stdout { \n codec => rubydebug", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:47:in compile_imperative'", "/usr/share/logstash/log │ │ stash-core/lib/logstash/compiler.rb:55:in compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:17:in block in compile_sources'", "org/jruby/RubyArray.java:2580:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compi │
│ ler.rb:14:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:161:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:27:in init │
│ ialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:326:in block in converge_state'"]}
│ logstash [2020-02-27T12:35:49,419][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of [A-Za-z0-9_-], [ \t\r\ │
│ \n], "#", "{", [A-Za-z0-9_], "}" at line 3, column 23 (byte 44) after output {\n stdout { \n codec => rubydebug", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:47:in compile_imperative'", "/usr/share/logstash/log │ │ stash-core/lib/logstash/compiler.rb:55:in compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:17:in block in compile_sources'", "org/jruby/RubyArray.java:2580:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compi │
│ ler.rb:14:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:161:in initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:27:in init │
│ ialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:36:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:326:in block in converge_state'"]}

While stdout { codec => rubydebug } without the metadata part works flawlessly (but doesnt show metadata)

Mutating the field into a var

mutate {
add_field => { "reason" => "%{[@metadata][dead_letter_queue][reason]}" }
}

gives this field:

"reason":"%{[@metadata][dead_letter_queue][reason]}"

To me its not obvious how i can make use of the dlq if i cannot find the reason to why they are put there in the first place.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.