Sha256: 39c786d302abe62e5a8d65091633d2c806a0ff1ac6c125c9a96fb5fe5766e33d
Contents?: true
Size: 1.65 KB
Versions: 3
Compression:
Stored size: 1.65 KB
Contents
# encoding: utf-8 require 'logstash/devutils/rspec/spec_helper' require 'logstash/outputs/kusto' require 'logstash/codecs/plain' require 'logstash/event' describe LogStash::Outputs::Kusto do let(:options) { { "path" => "./kusto_tst/%{+YYYY-MM-dd-HH-mm}", "ingest_url" => "mycluster", "app_id" => "myid", "app_key" => "mykey", "app_tenant" => "mytenant", "database" => "mydatabase", "table" => "mytable", "json_mapping" => "mymapping" } } describe '#register' do it 'doesnt allow the path to start with a dynamic string' do kusto = described_class.new(options.merge( {'path' => '/%{name}'} )) expect { kusto.register }.to raise_error(LogStash::ConfigurationError) kusto.close end it 'path must include a dynamic string to allow file rotation' do kusto = described_class.new(options.merge( {'path' => '/{name}'} )) expect { kusto.register }.to raise_error(LogStash::ConfigurationError) kusto.close end dynamic_name_array = ['/a%{name}/', '/a %{name}/', '/a- %{name}/', '/a- %{name}'] context 'doesnt allow the root directory to have some dynamic part' do dynamic_name_array.each do |test_path| it "with path: #{test_path}" do kusto = described_class.new(options.merge( {'path' => test_path} )) expect { kusto.register }.to raise_error(LogStash::ConfigurationError) kusto.close end end end it 'allow to have dynamic part after the file root' do kusto = described_class.new(options.merge({'path' => '/tmp/%{name}'})) expect { kusto.register }.not_to raise_error kusto.close end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
logstash-output-kusto-1.0.2-java | spec/outputs/kusto_spec.rb |
logstash-output-kusto-1.0.1-java | spec/outputs/kusto_spec.rb |
logstash-output-kusto-1.0.0-java | spec/outputs/kusto_spec.rb |