@@ -9,7 +9,7 @@ class LogStash::Outputs::Kusto < LogStash::Outputs::Base
99 # This handles the overall logic and communication with Kusto
1010 #
1111 class Ingestor
12- require 'kusto/KustoClient-0.1.6 .jar'
12+ require 'kusto/kusto-ingest-1.0.0-BETA-01-jar-with-dependencies .jar'
1313
1414 RETRY_DELAY_SECONDS = 3
1515 DEFAULT_THREADPOOL = Concurrent ::ThreadPoolExecutor . new (
@@ -29,11 +29,11 @@ def initialize(ingest_url, app_id, app_key, app_tenant, database, table, mapping
2929
3030 @logger . debug ( 'Preparing Kusto resources.' )
3131
32- kusto_connection_string = Java ::KustoConnectionStringBuilder . createWithAadApplicationCredentials ( ingest_url , app_id , app_key , app_tenant )
32+ kusto_connection_string = Java ::com . microsoft . azure . kusto . data . ConnectionStringBuilder . createWithAadApplicationCredentials ( ingest_url , app_id , app_key . value , app_tenant )
3333
34- @kusto_client = Java ::KustoIngestClient . new ( kusto_connection_string )
34+ @kusto_client = Java ::com . microsoft . azure . kusto . ingest . IngestClientFactory . createClient ( kusto_connection_string )
3535
36- @ingestion_properties = Java ::KustoIngestionProperties . new ( database , table )
36+ @ingestion_properties = Java ::com . microsoft . azure . kusto . ingest . IngestionProperties . new ( database , table )
3737 @ingestion_properties . setJsonMappingName ( mapping )
3838
3939 @delete_local = delete_local
@@ -48,12 +48,12 @@ def validate_config(database, table, mapping)
4848 end
4949
5050 if table =~ FIELD_REF
51- @logger . error ( 'table config value should not be dynamic.' , database )
51+ @logger . error ( 'table config value should not be dynamic.' , table )
5252 raise LogStash ::ConfigurationError . new ( 'table config value should not be dynamic.' )
5353 end
5454
5555 if mapping =~ FIELD_REF
56- @logger . error ( 'mapping config value should not be dynamic.' , database )
56+ @logger . error ( 'mapping config value should not be dynamic.' , mapping )
5757 raise LogStash ::ConfigurationError . new ( 'mapping config value should not be dynamic.' )
5858 end
5959 end
@@ -90,7 +90,8 @@ def upload(path, delete_on_success)
9090 # local_ingestion_properties.addJsonMappingName(mapping)
9191 # end
9292
93- @kusto_client . ingestFromSingleFile ( path , @ingestion_properties )
93+ file_source_info = Java ::com . microsoft . azure . kusto . ingest . source . FileSourceInfo . new ( path , 0 ) ; # 0 - let the sdk figure out the size of the file
94+ @kusto_client . ingestFromFile ( file_source_info , @ingestion_properties )
9495
9596 File . delete ( path ) if delete_on_success
9697
0 commit comments