lib/fluent/plugin/out_splunkapi.rb in fluent-plugin-splunkapi-0.1.2 vs lib/fluent/plugin/out_splunkapi.rb in fluent-plugin-splunkapi-0.1.3

- old
+ new

@@ -38,10 +38,12 @@ config_param :api_hostname, :string, :default => 'api.splunkstorm.com' config_param :project_id, :string, :default => nil # TODO: required with storm # Event parameters config_param :host, :string, :default => nil # TODO: auto-detect + config_param :index, :string, :default => nil + config_param :check_index, :bool, :default => true config_param :source, :string, :default => '{TAG}' config_param :sourcetype, :string, :default => 'fluent' # Formatting config_param :time_format, :string, :default => 'localtime' @@ -101,9 +103,11 @@ if @protocol == 'rest' @username, @password = @auth.split(':') @base_url = "https://#{@server}/services/receivers/simple?sourcetype=#{@sourcetype}" @base_url += "&host=#{@host}" if @host + @base_url += "&index=#{@index}" if @index + @base_url += "&check-index=false" unless @check_index elsif @protocol == 'storm' @username, @password = 'x', @access_token @base_url = "https://#{@api_hostname}/1/inputs/http?index=#{@project_id}&sourcetype=#{@sourcetype}" @base_url += "&host=#{@host}" if @host end