diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 777c1d65..b0878fc0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,11 +85,12 @@ jobs: sudo apt-get update && sudo apt-get install logstash - name: Install plugin run: sudo /usr/share/logstash/bin/logstash-plugin install logstash-kusto.gem - - run: sudo env "PATH=$PATH" bundle install - run: sudo chmod -R 777 /usr/share/logstash - run: sudo chmod -R 777 . + - run: bundle install + - run: lock_jars - name: Run e2e - run: ruby e2e.rb + run: jruby e2e.rb working-directory: 'e2e' env: ENGINE_URL: ${{ secrets.ENGINE_URL }} diff --git a/e2e/e2e.rb b/e2e/e2e.rb index 552d387e..d9b53508 100644 --- a/e2e/e2e.rb +++ b/e2e/e2e.rb @@ -115,7 +115,8 @@ def assert_data end def start - @query_client = $kusto_java.data.ClientImpl.new($kusto_java.data.ConnectionStringBuilder::createWithAadApplicationCredentials(@engine_url, @app_id, @app_kay, @tenant_id)) + @query_client = $kusto_java.data.ClientImpl.new($kusto_java.data.auth.ConnectionStringBuilder::createWithAadApplicationCredentials(@engine_url, @app_id, + @app_kay, @tenant_id)) create_table_and_mapping run_logstash assert_data diff --git a/lib/logstash/outputs/kusto/ingestor.rb b/lib/logstash/outputs/kusto/ingestor.rb index 9a64619a..3dd4412e 100644 --- a/lib/logstash/outputs/kusto/ingestor.rb +++ b/lib/logstash/outputs/kusto/ingestor.rb @@ -29,7 +29,7 @@ def initialize(ingest_url, app_id, app_key, app_tenant, database, table, json_ma @logger.debug('Preparing Kusto resources.') kusto_java = Java::com.microsoft.azure.kusto - kusto_connection_string = kusto_java.data.ConnectionStringBuilder.createWithAadApplicationCredentials(ingest_url, app_id, app_key.value, app_tenant) + kusto_connection_string = kusto_java.data.auth.ConnectionStringBuilder.createWithAadApplicationCredentials(ingest_url, app_id, app_key.value, app_tenant) @logger.debug(Gem.loaded_specs.to_s) # Unfortunately there's no way to avoid using the gem/plugin name directly... name_for_tracing = "logstash-output-kusto:#{Gem.loaded_specs['logstash-output-kusto']&.version || "unknown"}" diff --git a/logstash-output-kusto.gemspec b/logstash-output-kusto.gemspec index 38689746..87bfa12c 100644 --- a/logstash-output-kusto.gemspec +++ b/logstash-output-kusto.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'logstash-output-kusto' #WATCH OUT: we hardcoded usage of this name in one of the classes. - s.version = '1.0.2' + s.version = '1.0.3' s.licenses = ['Apache-2.0'] s.summary = 'Writes events to Azure Data Explorer (Kusto)' s.description = 'This is a logstash output plugin used to write events to an Azure Data Explorer (a.k.a Kusto)' @@ -30,6 +30,6 @@ Gem::Specification.new do |s| s.add_development_dependency 'ruby-maven', '~> 3.3.11' # Jar dependencies - s.requirements << "jar 'com.microsoft.azure.kusto, kusto-ingest, 2.1.2" + s.requirements << "jar 'com.microsoft.azure.kusto, kusto-ingest, 2.8.2" s.add_runtime_dependency 'jar-dependencies' end diff --git a/spec/outputs/kusto/ingestor_spec.rb b/spec/outputs/kusto/ingestor_spec.rb index d7a094c7..88560439 100644 --- a/spec/outputs/kusto/ingestor_spec.rb +++ b/spec/outputs/kusto/ingestor_spec.rb @@ -5,7 +5,7 @@ describe LogStash::Outputs::Kusto::Ingestor do - let(:ingest_url) { "mycluster" } + let(:ingest_url) { "https://ingest-sdkse2etest.eastus.kusto.windows.net/" } let(:app_id) { "myid" } let(:app_key) { LogStash::Util::Password.new("mykey") } let(:app_tenant) { "mytenant" } diff --git a/spec/outputs/kusto_spec.rb b/spec/outputs/kusto_spec.rb index ec048ba9..7ef375c5 100644 --- a/spec/outputs/kusto_spec.rb +++ b/spec/outputs/kusto_spec.rb @@ -7,7 +7,7 @@ describe LogStash::Outputs::Kusto do let(:options) { { "path" => "./kusto_tst/%{+YYYY-MM-dd-HH-mm}", - "ingest_url" => "mycluster", + "ingest_url" => "https://ingest-sdkse2etest.eastus.kusto.windows.net/", "app_id" => "myid", "app_key" => "mykey", "app_tenant" => "mytenant",