From b7c084c7ac7dab353e847b4066ca7066c85160d8 Mon Sep 17 00:00:00 2001 From: Ramachandran A G Date: Thu, 12 Oct 2023 15:55:41 +0530 Subject: [PATCH] Fix review comments --- README.md | 2 +- lib/logstash/outputs/kusto/ingestor.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a4e9765..f2bda2b 100755 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ More information about configuring Logstash can be found in the [logstash config | **path** | The plugin writes events to temporary files before sending them to ADX. This parameter includes a path where files should be written and a time expression for file rotation to trigger an upload to the ADX service. The example above shows how to rotate the files every minute and check the Logstash docs for more information on time expressions. | Required | **ingest_url** | The Kusto endpoint for ingestion-related communication. See it on the Azure Portal.| Required| | **app_id, app_key, app_tenant**| Credentials required to connect to the ADX service. Be sure to use an application with 'ingest' privileges. | Optional| -| **managed_identity**| Managed identity id (ClientId GUID in case of User managed identity or system in case of system managed identity). The id needs to have 'ingest' privileges | Optional| +| **managed_identity**| Managed Identity to authenticate. For user-based managed ID, use the Client ID GUID. For system-based, use the value `system`. The ID needs to have 'ingest' privileges on the cluster. | Optional| | **database**| Database name to place events | Required | | **table** | Target table name to place events | Required | **json_mapping** | Maps each attribute from incoming event JSON strings to the appropriate column in the table. Note that this must be in JSON format, as this is the interface between Logstash and Kusto | Required | diff --git a/lib/logstash/outputs/kusto/ingestor.rb b/lib/logstash/outputs/kusto/ingestor.rb index 00710c7..8f15df8 100755 --- a/lib/logstash/outputs/kusto/ingestor.rb +++ b/lib/logstash/outputs/kusto/ingestor.rb @@ -36,8 +36,7 @@ def initialize(ingest_url, app_id, app_key, app_tenant, managed_identity_id, dat # Is it direct connection is_direct_conn = (proxy_host.nil? || proxy_host.empty?) # Create a connection string - kusto_connection_string = begin - if is_managed_identity + kusto_connection_string = if is_managed_identity if is_system_assigned_managed_identity @logger.info('Using system managed identity.') kusto_java.data.auth.ConnectionStringBuilder.createWithAadManagedIdentity(ingest_url) @@ -48,7 +47,7 @@ def initialize(ingest_url, app_id, app_key, app_tenant, managed_identity_id, dat else kusto_java.data.auth.ConnectionStringBuilder.createWithAadApplicationCredentials(ingest_url, app_id, app_key.value, app_tenant) end - end + # @logger.debug(Gem.loaded_specs.to_s) # Unfortunately there's no way to avoid using the gem/plugin name directly...