logstash-output-file 4.2.3 → 4.2.4

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
  SHA256:
3
- metadata.gz: 78aedcb63cb389b41d17503f87635ec447cbc269f18baad841bfea2c408a469b
4
- data.tar.gz: e70110d9d07786b566094f9b5012d2ff39eaba76312555be287c11f1e0de16bf
3
+ metadata.gz: 8b77d049c54896ab49beffdcfdc6c3d6263319550291b8e3e9bb7adbf693e132
4
+ data.tar.gz: 6c5149e2312badb7e33779600d0c65d43e0d1218ae0a7c0290f26878b706a71b
5
5
  SHA512:
6
- metadata.gz: 43b2c79e85f0a59559bd48b762a1cf997f3037c65fb4e650d7d9e83cc4d4f7bc86e64a958c0ecb3568ef0b8bd519999573e68015ff6cb2d0c4f25bc00845ecc9
7
- data.tar.gz: 57bfc0a2394ecdad15cd43b1777fff7c4285afa12edc833f48d3a1a0425afe89cc20f98f0be4b6a4bb64b1295d2be45a6bbf8127d602123c5b730973595e0b94
6
+ metadata.gz: 9040baa58fe70550583bdf6c745ca9f40a7317b660e961626ec1024f000850b3c8bb5d895d2ed12c95a85c66aadf889126c78dd9428bb35b63c7b591c3292678
7
+ data.tar.gz: d30d10c42110e1da662eda8a87ecc0e3d769502f2ea2e9b14f42e1cb3d82911f139f9e21c56a79ca2f9c2cae13722e09b8445931bc93e3b6dd0c12d0426fbebd
@@ -1,3 +1,6 @@
1
+ ## 4.2.4
2
+ - Fix a bug where flush interval was being called for each event when enabled #67
3
+
1
4
  ## 4.2.3
2
5
  - Docs: Set the default_codec doc attribute.
3
6
 
@@ -18,7 +18,7 @@ require "zlib"
18
18
  # }
19
19
  class LogStash::Outputs::File < LogStash::Outputs::Base
20
20
  concurrency :shared
21
-
21
+
22
22
  FIELD_REF = /%\{[^}]+\}/
23
23
 
24
24
  config_name "file"
@@ -48,7 +48,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
48
48
  # into this file and inside the defined path.
49
49
  config :filename_failure, :validate => :string, :default => '_filepath_failures'
50
50
 
51
- # If the configured file is deleted, but an event is handled by the plugin,
51
+ # If the configured file is deleted, but an event is handled by the plugin,
52
52
  # the plugin will recreate the file. Default => true
53
53
  config :create_if_deleted, :validate => :boolean, :default => true
54
54
 
@@ -82,7 +82,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
82
82
 
83
83
  @files = {}
84
84
  @io_mutex = Mutex.new
85
-
85
+
86
86
  @path = File.expand_path(path)
87
87
 
88
88
  validate_path
@@ -141,18 +141,18 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
141
141
  # append to the file
142
142
  chunks.each {|chunk| fd.write(chunk) }
143
143
  end
144
- fd.flush
144
+ flush(fd)
145
145
  end
146
-
146
+
147
147
  close_stale_files
148
- end
148
+ end
149
149
  end # def receive
150
150
 
151
151
  public
152
152
  def close
153
153
  @io_mutex.synchronize do
154
154
  @logger.debug("Close: closing files")
155
-
155
+
156
156
  @files.each do |path, fd|
157
157
  begin
158
158
  fd.close
@@ -180,8 +180,8 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
180
180
  file_output_path = @failure_path
181
181
  end
182
182
  @logger.debug("File, writing event to file.", :filename => file_output_path)
183
-
184
- file_output_path
183
+
184
+ file_output_path
185
185
  end
186
186
 
187
187
  private
@@ -219,7 +219,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
219
219
  @logger.debug("Flushing file", :path => path, :fd => fd)
220
220
  fd.flush
221
221
  end
222
-
222
+
223
223
  @last_flush_cycle = Time.now
224
224
  end
225
225
 
@@ -268,7 +268,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
268
268
  end
269
269
 
270
270
  @logger.info("Opening file", :path => path)
271
-
271
+
272
272
  dir = File.dirname(path)
273
273
  if !Dir.exist?(dir)
274
274
  @logger.info("Creating directory", :directory => dir)
@@ -278,7 +278,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
278
278
  FileUtils.mkdir_p(dir)
279
279
  end
280
280
  end
281
-
281
+
282
282
  # work around a bug opening fifos (bug JRUBY-6280)
283
283
  stat = File.stat(path) rescue nil
284
284
  if stat && stat.ftype == "fifo" && LogStash::Environment.jruby?
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-file'
4
- s.version = '4.2.3'
4
+ s.version = '4.2.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Writes events to files on disk"
7
7
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -119,7 +119,8 @@ describe LogStash::Outputs::File do
119
119
  {
120
120
  "write_behavior" => "overwrite",
121
121
  "path" => tmp,
122
- "codec" => LogStash::Codecs::JSONLines.new
122
+ "codec" => LogStash::Codecs::JSONLines.new,
123
+ "flush_interval" => 0
123
124
  }
124
125
  }
125
126
  let(:output) { LogStash::Outputs::File.new(config) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.3
4
+ version: 4.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-06 00:00:00.000000000 Z
11
+ date: 2018-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  requirements: []
142
142
  rubyforge_project:
143
- rubygems_version: 2.6.11
143
+ rubygems_version: 2.6.13
144
144
  signing_key:
145
145
  specification_version: 4
146
146
  summary: Writes events to files on disk