Skip to content

Commit

Permalink
fix optional hash arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisecheng committed May 12, 2023
1 parent 610f48d commit cf2b2ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/logstash/filters/dictionary/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class File

include LogStash::Util::Loggable

def self.create(path, refresh_interval, refresh_behaviour, exact, regex, yaml_code_point_limit)
def self.create(path, refresh_interval, refresh_behaviour, exact, regex, **file_type_args)
if /\.y[a]?ml$/.match(path)
instance = YamlFile.new(path, refresh_interval, exact, regex, yaml_code_point_limit)
instance = YamlFile.new(path, refresh_interval, exact, regex, file_type_args)
elsif path.end_with?(".json")
instance = JsonFile.new(path, refresh_interval, exact, regex)
elsif path.end_with?(".csv")
Expand Down Expand Up @@ -39,7 +39,7 @@ def initialize(path, refresh_interval, exact, regex, **file_type_args)
@write_lock = rw_lock.writeLock
@dictionary = Hash.new
@update_method = method(:merge_dictionary)
initialize_for_file_type(yaml_code_point_limit: file_type_args[:yaml_code_point_limit])
initialize_for_file_type(file_type_args)
args = [@dictionary, rw_lock]
klass = case
when exact && regex then FetchStrategy::File::ExactRegex
Expand Down

0 comments on commit cf2b2ff

Please sign in to comment.