Skip to content

Commit

Permalink
Update to the latest kusto java version, to receive the latest featur…
Browse files Browse the repository at this point in the history
…es and fixes (#35)

* Update to the latest kusto java version, to receive the latest features and fixes.
  • Loading branch information
AsafMah authored Jul 5, 2021
1 parent 9f5bb1b commit 647b41e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion e2e/e2e.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/logstash/outputs/kusto/ingestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"
Expand Down
4 changes: 2 additions & 2 deletions logstash-output-kusto.gemspec
Original file line number Diff line number Diff line change
@@ -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)'
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/outputs/kusto/ingestor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion spec/outputs/kusto_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 647b41e

Please sign in to comment.