fluent-plugin-azurestorage-gen2 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f30aa7c60fa869b86eb0d921aab12831c6355b6
4
- data.tar.gz: 522010167e94cb9500e89b13aa68c4ec0bba1053
3
+ metadata.gz: c4b4636ae463e1d010ac8b6c069c1c9e47d226a9
4
+ data.tar.gz: b215a1aa8a4c8c9e768b38f1ee3a318b8d5f42a2
5
5
  SHA512:
6
- metadata.gz: 5d40bc5c3964bd9187e6710dbda66f7e3556f310425120cf2c46da19a34c8905676278f4428d744a3255ce83e55bf8bdd2791dae755b25aefcf32d39e771c8b6
7
- data.tar.gz: 149ee0c0ffc588e048fd0fa87cc343af153d6dc6de4132e9ace1d06f13b80e9d4f6ca60dba1892972693e6dfb37fc0dc649e233e538ccdcf982bbbc6540d1d1f
6
+ metadata.gz: 8c7eb7bd110a30963f4cc5b99303829d234b9285a7a29e4b9eb3115511e0c7870f06f94cf237b60ce8cd76e74a0c634a71341747b0991b5080f7dbab2f94ec3f
7
+ data.tar.gz: a02576ae303d449b2d2301c88d80e076792acf58d90b50fafa4822a3ab96581f1566ccb052cd153d42a323fb4563575b648271f89a9220d815ba1a3d5f953be2
data/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  | fluent-plugin-azurestorage-gen2 | fluentd | ruby |
11
11
  |------------------------|---------|------|
12
- | >= 0.1.6 | >= v0.14.0 | >= 2.4 |
12
+ | >= 0.2.0 | >= v0.14.0 | >= 2.4 |
13
13
 
14
14
  ## Overview
15
15
 
@@ -37,6 +37,7 @@ $ gem install fluent-plugin-azurestorage-gen2
37
37
  file_extension log
38
38
  path "/cluster-logs/myfolder/${tag[1]}-#{Socket.gethostname}-%M"
39
39
  auto_create_container true
40
+ format single_value
40
41
  <buffer tag,time>
41
42
  @type file
42
43
  path /var/log/fluent/azurestorage-buffer
@@ -63,6 +64,7 @@ $ gem install fluent-plugin-azurestorage-gen2
63
64
  file_extension log
64
65
  path "/cluster-logs/myfolder/${tag[1]}-#{Socket.gethostname}-%M"
65
66
  auto_create_container true
67
+ format single_value
66
68
  <buffer tag,time>
67
69
  @type file
68
70
  path /var/log/fluent/azurestorage-buffer
@@ -103,7 +105,7 @@ OAuth client secret that is used for OAuth based authentication. Required if OAu
103
105
 
104
106
  ### azure_oauth_refresh_interval
105
107
 
106
- OAuth2 access token refreshment interval in second. Only applies when MSI / OAuth authentication is used.
108
+ OAuth2 access token refreshment interval in second. Only applies when MSI / OAuth authentication is used. (default value is 59 minutes)
107
109
 
108
110
  ### azure_oauth_use_azure_cli (Preview)
109
111
 
@@ -173,13 +175,13 @@ azure_object_key_format %{path}/events/ts=%{time_slice}/events_%{index}-%{hostna
173
175
 
174
176
  ### file_extension
175
177
 
176
- File extension for the uploaded files. Only uses if `store_as` is not set, or set as `none`
178
+ File extension for the uploaded files. Only used if `store_as` is not set, or set as `none`
177
179
 
178
180
  ### store_as
179
181
 
180
182
  Archive format on Azure Storage. You can use following types:
181
183
 
182
- - none (default - no tmp file creation for log processing)
184
+ - none (default - no tmp file creation for log processing, use with json or single value format)
183
185
  - gzip
184
186
  - json
185
187
  - text
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.2.0
@@ -27,7 +27,7 @@ module Fluent::Plugin
27
27
  config_param :azure_oauth_secret, :string, :default => nil, :secret => true
28
28
  config_param :azure_oauth_tenant_id, :string, :default => nil
29
29
  config_param :azure_oauth_use_azure_cli, :bool, :default => false
30
- config_param :azure_oauth_refresh_interval, :integer, :default => 60 * 60 # one hour
30
+ config_param :azure_oauth_refresh_interval, :integer, :default => 60 * 59 # 59 minutes, do not wait one hour
31
31
  config_param :azure_container, :string, :default => nil
32
32
  config_param :azure_object_key_format, :string, :default => "%{path}%{time_slice}_%{index}.%{file_extension}"
33
33
  config_param :file_extension, :string, :default => "log"
@@ -37,7 +37,6 @@ module Fluent::Plugin
37
37
  config_param :format, :string, :default => "out_file"
38
38
  config_param :time_slice_format, :string, :default => '%Y%m%d'
39
39
  config_param :command_parameter, :string, :default => nil
40
- config_param :message_field, :string, :default => nil
41
40
 
42
41
  DEFAULT_FORMAT_TYPE = "out_file"
43
42
  URL_DOMAIN_SUFFIX = '.dfs.core.windows.net'
@@ -118,21 +117,14 @@ module Fluent::Plugin
118
117
  def write(chunk)
119
118
  metadata = chunk.metadata
120
119
  if @store_as.nil? || @store_as == "none"
121
- raw_data=''
122
120
  generate_log_name(metadata, @current_index)
123
121
  if @last_azure_storage_path != @azure_storage_path
124
122
  @current_index = 0
125
123
  generate_log_name(metadata, @current_index)
126
124
  end
127
- chunk.each do |emit_time, record|
128
- if @message_field.nil? || @message_field.empty?
129
- raw_data << "#{Yajl.dump(record)}\n"
130
- elsif record.key?(@message_field)
131
- line = record[@message_field].chomp
132
- raw_data << "#{line}\n"
133
- end
134
- end
125
+ raw_data = chunk.read
135
126
  unless raw_data.empty?
127
+ log.debug "azurestorage_gen2: processing raw data", chunk_id: dump_unique_id_hex(chunk.unique_id)
136
128
  upload_blob(raw_data, metadata)
137
129
  end
138
130
  @last_azure_storage_path = @azure_storage_path
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azurestorage-gen2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Szabo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-03 00:00:00.000000000 Z
11
+ date: 2020-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd