Skip to content

Commit 7e79868

Browse files
committed
Use distinct files per plugin's database & table (#16)
1 parent 26c0e74 commit 7e79868

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/logstash/outputs/kusto.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ def register
113113
# TODO: add id to the tmp path to support multiple outputs of the same type
114114
# add fields from the meta that will note the destination of the events in the file
115115
@path = if dynamic_event_routing
116-
File.expand_path("#{path}.kusto.%{[@metadata][database]}.%{[@metadata][table]}.%{[@metadata][mapping]}")
116+
File.expand_path("#{path}.%{[@metadata][database]}.%{[@metadata][table]}.%{[@metadata][mapping]}")
117117
else
118-
File.expand_path("#{path}.kusto")
118+
File.expand_path("#{path}.#{database}.#{table}")
119119
end
120120

121121
validate_path
@@ -365,7 +365,7 @@ def recover_past_files
365365
return unless Dir.exist?(new_path)
366366
@logger.info("Going to recover old files in path #{@new_path}")
367367

368-
old_files = Find.find(new_path).select { |p| /.*\.kusto$/ =~ p }
368+
old_files = Find.find(new_path).select { |p| /.*\.#{database}\.#{table}$/ =~ p }
369369
@logger.info("Found #{old_files.length} old file(s), sending them now...")
370370

371371
old_files.each do |file|

0 commit comments

Comments
 (0)