Skip to content

Commit

Permalink
Modifing validation for paths
Browse files Browse the repository at this point in the history
See LOGSTASH-942 for more info
  • Loading branch information
Richard Pijnenburg committed Mar 6, 2013
1 parent 27b3500 commit ea2e1be
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/logstash/filters/geoip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LogStash::Filters::GeoIP < LogStash::Filters::Base
#
# If not specified, this will default to the GeoLiteCity database that ships
# with logstash.
config :database, :validate => :string
config :database, :validate => :path

# The field containing IP address, hostname is also OK. If this field is an
# array, only the first value will be used.
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/filters/translate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LogStash::Filters::Translate < LogStash::Filters::Base
# make sure you encase any integer based keys in quotes.
# For simple string search and replacements for just a few values
# use the gsub function of the mutate filter.
config :dictionary_path, :validate => :string, :required => true
config :dictionary_path, :validate => :path, :required => true

# The destination you wish to populate with the response code.
# default is http_response_code. set to the same value as source
Expand Down
4 changes: 2 additions & 2 deletions lib/logstash/inputs/lumberjack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class LogStash::Inputs::Lumberjack < LogStash::Inputs::Base
config :port, :validate => :number, :required => true

# ssl certificate to use
config :ssl_certificate, :validate => :string, :required => true
config :ssl_certificate, :validate => :path, :required => true

# ssl key to use
config :ssl_key, :validate => :string, :required => true
config :ssl_key, :validate => :path, :required => true

# ssl key passphrase to use
config :ssl_key_passphrase, :validate => :password
Expand Down
6 changes: 3 additions & 3 deletions lib/logstash/inputs/tcp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class Interrupted < StandardError; end

# ssl CA certificate, chainfile or CA path
# The system CA path is automatically included
config :ssl_cacert, :validate => :string
config :ssl_cacert, :validate => :path

# ssl certificate
config :ssl_cert, :validate => :string
config :ssl_cert, :validate => :path

# ssl key
config :ssl_key, :validate => :string
config :ssl_key, :validate => :path

# ssl key passphrase
config :ssl_key_passphrase, :validate => :password, :default => nil
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/outputs/lumberjack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LogStash::Outputs::Lumberjack < LogStash::Outputs::Base
config :port, :validate => :number, :required => true

# ssl certificate to use
config :ssl_certificate, :validate => :string, :required => true
config :ssl_certificate, :validate => :path, :required => true

# window size
config :window_size, :validate => :number, :default => 5000
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/outputs/nagios.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class LogStash::Outputs::Nagios < LogStash::Outputs::Base
plugin_status "beta"

# The path to your nagios command file
config :commandfile, :validate => :string, :default => "/var/lib/nagios3/rw/nagios.cmd"
config :commandfile, :validate => :path, :default => "/var/lib/nagios3/rw/nagios.cmd"

# The Nagios check level. Should be one of 0=OK, 1=WARNING, 2=CRITICAL,
# 3=UNKNOWN. Defaults to 2 - CRITICAL.
Expand Down
4 changes: 2 additions & 2 deletions lib/logstash/outputs/nagios_nsca.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
config :port, :validate => :number, :default => 5667

# The path to the 'send_nsca' binary on the local host.
config :send_nsca_bin, :validate => :string, :default => "/usr/sbin/send_nsca"
config :send_nsca_bin, :validate => :path, :default => "/usr/sbin/send_nsca"

# The path to the send_nsca config file on the local host.
# Leave blank if you don't want to provide a config file.
config :send_nsca_config, :validate => :string
config :send_nsca_config, :validate => :path

# The nagios 'host' you want to submit a passive check result to. This
# parameter accepts interpolation, e.g. you can use @source_host or other
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/outputs/zabbix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class LogStash::Outputs::Zabbix < LogStash::Outputs::Base

config :host, :validate => :string, :default => "localhost"
config :port, :validate => :number, :default => 10051
config :zabbix_sender, :validate => :string, :default => "/usr/local/bin/zabbix_sender"
config :zabbix_sender, :validate => :path, :default => "/usr/local/bin/zabbix_sender"

public
def register
Expand Down

0 comments on commit ea2e1be

Please sign in to comment.