logstash-output-csv 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 74dd7ef63fed3df056bcdd082e599f0dbcaa6723
4
- data.tar.gz: 91a0932faf62b491baec76a5e3d3444ee1bb0ef8
3
+ metadata.gz: cf27eb2bd2a2c7f319206b2551e773db1b1384fa
4
+ data.tar.gz: b39854c4fb69d80283c5948dd51b8e024403995c
5
5
  SHA512:
6
- metadata.gz: 59dbf98e009b4e68cd76362e4f7cd2744aae985ab564c9ac8ad9f62c9209b38c24620c562042468fe1d447699812c0b87606c2028115706e04f77ac5eae83c85
7
- data.tar.gz: dd55a2561c0e7e8a7b1fe977dee7cbe89b9019a46dbefd88058b4e261eb48ae15202587051fa64343dfbda970e94c971f7fed3df4362eee22b21d2087acb843e
6
+ metadata.gz: abfe83405456fb2f8104ba51c3728c3548db5707971009d4490f5c6276158c934d995350723e3a63465e7379ac421db2106fce3906a37d0cb8c6de282e0e0909
7
+ data.tar.gz: 7e8a4ff31b01e17edfe7dfcbfef730898e293fd8cc2bae3c2d9a1ec2c5002dd0037bdd59f74b63fb769cc0f9a41986b19c6ba9ca5ec5573a8003e9f6ffe3fd51
data/CHANGELOG.md CHANGED
@@ -1,16 +1,24 @@
1
+ ## 3.0.3
2
+ - Use new Logsash 2.4/5.0 APIs for working batchwise and with shared concurrency (fix for https://github.com/logstash-plugins/logstash-output-csv/issues/10)
3
+ - this update aligns with its subclass logstash-output-file version 4.0.0, https://github.com/logstash-plugins/logstash-output-file
4
+
1
5
  ## 3.0.2
2
6
  - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
3
7
 
4
8
  ## 3.0.1
5
9
  - Republish all the gems under jruby.
10
+
6
11
  ## 3.0.0
7
12
  - Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
8
- # 2.0.5
13
+
14
+ ## 2.0.5
9
15
  - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
10
- # 2.0.4
16
+
17
+ ## 2.0.4
11
18
  - New dependency requirements for logstash-core for the 5.0 release
19
+
12
20
  ## 2.0.3
13
- - Escape rogue values by default, which can be interpreted by spreadsheet apps. Add option to turn it off
21
+ - Escape rogue values by default, which can be interpreted by spreadsheet apps. Add option to turn it off
14
22
 
15
23
  ## 2.0.0
16
24
  - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
@@ -33,18 +33,32 @@ class LogStash::Outputs::CSV < LogStash::Outputs::File
33
33
  end
34
34
 
35
35
  public
36
- def receive(event)
36
+ def multi_receive_encoded(events_and_encoded)
37
+ encoded_by_path = Hash.new {|h,k| h[k] = []}
37
38
 
38
- path = event.sprintf(@path)
39
- fd = open(path)
40
- csv_values = @fields.map {|name| get_value(name, event)}
41
- fd.write(csv_values.to_csv(@csv_options))
39
+ events_and_encoded.each do |event,encoded|
40
+ file_output_path = event_path(event)
41
+ encoded_by_path[file_output_path] << event_to_csv(event)
42
+ end
43
+
44
+ @io_mutex.synchronize do
45
+ encoded_by_path.each do |path,chunks|
46
+ fd = open(path)
47
+ chunks.each {|chunk| fd.write(chunk) }
48
+ fd.flush
49
+ end
42
50
 
43
- flush(fd)
44
- close_stale_files
45
- end #def receive
51
+ close_stale_files
52
+ end
53
+ end
46
54
 
47
55
  private
56
+
57
+ def event_to_csv(event)
58
+ csv_values = @fields.map {|name| get_value(name, event)}
59
+ csv_values.to_csv(@csv_options)
60
+ end
61
+
48
62
  def get_value(name, event)
49
63
  val = event.get(name)
50
64
  val.is_a?(Hash) ? LogStash::Json.dump(val) : escape_csv(val)
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-csv'
4
- s.version = '3.0.2'
4
+ s.version = '3.0.3'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Write events to disk in CSV or other delimited format"
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"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.6.3
126
+ rubygems_version: 2.4.8
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Write events to disk in CSV or other delimited format