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