mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
parent
2844a179cf
commit
e8a1164b2f
2 changed files with 13 additions and 7 deletions
|
@ -113,12 +113,16 @@ module LogStash; class BasePipeline
|
|||
# Collapse the array of arguments into a single merged hash
|
||||
args = args.reduce({}, &:merge)
|
||||
|
||||
# Pull the ID from LIR to keep IDs consistent between the two representations
|
||||
id = lir.graph.vertices.filter do |v|
|
||||
v.source_with_metadata &&
|
||||
v.source_with_metadata.line == line &&
|
||||
v.source_with_metadata.column == column
|
||||
end.findFirst.get.id
|
||||
if plugin_type == "codec"
|
||||
id = SecureRandom.uuid # codecs don't really use their IDs for metrics, so we can use anything here
|
||||
else
|
||||
# Pull the ID from LIR to keep IDs consistent between the two representations
|
||||
id = lir.graph.vertices.filter do |v|
|
||||
v.source_with_metadata &&
|
||||
v.source_with_metadata.line == line &&
|
||||
v.source_with_metadata.column == column
|
||||
end.findFirst.get.id
|
||||
end
|
||||
|
||||
args["id"] = id # some code pulls the id out of the args
|
||||
|
||||
|
|
|
@ -41,6 +41,8 @@ class DummyCodec < LogStash::Codecs::Base
|
|||
config_name "dummycodec"
|
||||
milestone 2
|
||||
|
||||
config :format, :validate => :string
|
||||
|
||||
def decode(data)
|
||||
data
|
||||
end
|
||||
|
@ -373,7 +375,7 @@ describe LogStash::Pipeline do
|
|||
allow(LogStash::Plugin).to receive(:lookup).with("output", "dummyoutput").and_return(::LogStash::Outputs::DummyOutput)
|
||||
end
|
||||
|
||||
let(:config) { "input { dummyinput {} } filter { dummyfilter {} } output { dummyoutput {} }"}
|
||||
let(:config) { "input { dummyinput { codec => plain { format => 'something' } } } filter { dummyfilter {} } output { dummyoutput {} }"}
|
||||
let(:pipeline) { mock_pipeline_from_string(config) }
|
||||
|
||||
after do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue