mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- add deprecation message for the 'format' setting
- correctly load the codecs for format's setting
This commit is contained in:
parent
939817dd6c
commit
42b5e8dc31
1 changed files with 5 additions and 3 deletions
|
@ -31,7 +31,7 @@ class LogStash::Inputs::Base < LogStash::Plugin
|
|||
config :debug, :validate => :boolean, :default => false
|
||||
|
||||
# The format of input data (plain, json, json_event)
|
||||
config :format, :validate => ["plain", "json", "json_event", "msgpack_event"], :deprecated => true
|
||||
config :format, :validate => ["plain", "json", "json_event", "msgpack_event"], :deprecated => "You should use the newer 'codec' setting instead."
|
||||
|
||||
# The codec used for input data
|
||||
config :codec, :validate => :codec, :default => "plain"
|
||||
|
@ -84,8 +84,10 @@ class LogStash::Inputs::Base < LogStash::Plugin
|
|||
# Backwards compat for the 'format' setting
|
||||
case @format
|
||||
when "plain"; # do nothing
|
||||
when "json"; @codec = LogStash::Codecs::JSON.new
|
||||
when "json_event"; @codec = LogStash::Codecs::OldLogStashJSON.new
|
||||
when "json"
|
||||
@codec = LogStash::Plugin.lookup("codec", "json").new
|
||||
when "json_event"
|
||||
@codec = LogStash::Plugin.lookup("codec", "oldlogstashjson").new
|
||||
end
|
||||
|
||||
end # def initialize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue