From cbb7444fafd1f6bf916c8ef55ea89c99de0eac1f Mon Sep 17 00:00:00 2001 From: monishkadas-ms Date: Thu, 12 Sep 2024 22:02:06 +0530 Subject: [PATCH] added custom_size_based_buffer class Added the feature for size and time based flushing of buffer. Added config options for max_interval and max_size. Once either one is reached the events stored in the buffer will be flushed. Updated kusto.rb --- lib/logstash/outputs/kusto.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/logstash/outputs/kusto.rb b/lib/logstash/outputs/kusto.rb index 741226e..b650a20 100755 --- a/lib/logstash/outputs/kusto.rb +++ b/lib/logstash/outputs/kusto.rb @@ -96,10 +96,6 @@ class LogStash::Outputs::Kusto < LogStash::Outputs::Base # Mapping name - deprecated, use json_mapping config :mapping, validate: :string, deprecated: true - config :max_size, validate => :number, default => 1000 - - config :max_interval, validate => :number, default => 60 - # Determines if local files used for temporary storage will be deleted # after upload is successful config :delete_temp_files, validate: :boolean, default: true @@ -123,6 +119,12 @@ class LogStash::Outputs::Kusto < LogStash::Outputs::Base # Check Proxy URL can be over http or https. Dowe need it this way or ignore this & remove this config :proxy_protocol, validate: :string, required: false , default: 'http' + # Maximum size (number of events) of the buffer before it gets flushed, defaults to 1000 + config :max_size, validate: :number, default: 1000 + + # Maximum interval (in seconds) before the buffer gets flushed, defaults to 60 + config :max_interval, validate: :number, default: 60 + default :codec, 'json_lines' def register