Skip to content

Commit

Permalink
* Fix DataMapping format when mapping is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
ag-ramachandran committed Apr 2, 2024
1 parent 4492872 commit e142caf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ gradle/wrapper/gradle-wrapper.properties
rspec.xml
e2e/output_file.txt
logs.txt
docker-e2e/.env
3 changes: 2 additions & 1 deletion lib/logstash/outputs/kusto/ingestor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ def initialize(ingest_url, app_id, app_key, app_tenant, managed_identity_id, dat
is_mapping_ref_provided = !(json_mapping.nil? || json_mapping.empty?)
if is_mapping_ref_provided
@logger.debug('Using mapping reference.', json_mapping)
@ingestion_properties.setIngestionMapping(json_mapping, kusto_java.ingest.IngestionMapping::IngestionMappingKind::JSON)
@ingestion_properties.setDataFormat(kusto_java.ingest.IngestionProperties::DataFormat::JSON)
else
@logger.debug('No mapping reference provided. Columns will be mapped by names in the logstash output')
end
# default mapping is JSON
@ingestion_properties.setIngestionMapping(json_mapping, kusto_java.ingest.IngestionMapping::IngestionMappingKind::JSON)
@delete_local = delete_local
@logger.debug('Kusto resources are ready.')
end
Expand Down

0 comments on commit e142caf

Please sign in to comment.