logstash-output-picsv 1.0.5.1 → 1.0.6

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: ea2d0b9ef166adb04ad2572ba4c19bca0ff4c84f
4
- data.tar.gz: 1c62bdb5f4e5eabf4b7219ec67ad2e0389aa2b6b
3
+ metadata.gz: 31157d03b1a1a074448e9aa65e94987f0d366036
4
+ data.tar.gz: e557fb27e6e1dc7b6620ae8ecc993529b0bbb58e
5
5
  SHA512:
6
- metadata.gz: 47c3a827a8136846799b4a4c08cc58deedc8dcc4b020b861da3aca456cceb0c194a1409829320d195c52e1c36f83ce90c8a0489928a8d3de7a8d7b1479f31367
7
- data.tar.gz: 2e4e842ba559e6ba29264b8c036c58cb88d2532715f1ce24fa7bbbc86a2d8e7187b15d07917a40767f7889af01199e666b6eb12ea71035dfc7c50a9a2bcfe5d4
6
+ metadata.gz: c7cff5cbd81a8e1d334dbbeb8b4b17d5c55894c0cbdcee4743f1cb2f61a63c6eebdca289bdd6ac9bd90546cff1ab8f1d0929b39e43d90cdfbb0a8df94438e93a
7
+ data.tar.gz: abf9350c4c261bb714ce984e0d08c8bd51a3acc7ffadde6e322c0ada93960ea40f2373d373ef2aa26607acc0a956dea0b7317a58a2ac0af200407934ad1c2814
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+
2
+ .DS_Store
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
- # gem "logstash", :github => "elastic/logstash", :branch => "2.4"
3
+ gem "logstash", :github => "elastic/logstash", :branch => "2.4"
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "logstash/devutils/rake"
@@ -1,29 +1,28 @@
1
1
  ############################################
2
2
  #
3
- # PICSV
3
+ # picsv
4
4
  #
5
5
  # Logstash mediation output for IOA PI
6
6
  #
7
7
  # Version 030815.1 Robert Mckeown
8
- # Version 030815.9 Jim Ray
8
+ # Version 030815.2 Jim Ray
9
9
  #
10
10
  ############################################
11
- # encoding: utf-8
12
11
 
13
- require "logstash/outputs/file"
14
- require "logstash/namespace"
15
12
  require "csv"
13
+ require "logstash/namespace"
14
+ require "logstash/outputs/file"
16
15
  require 'java' # for the java data format stuff
17
16
 
18
- # PICSV - based upon original Logstash CSV output.
17
+ # SCACSV - based upon original Logstash CSV output.
19
18
  #
20
19
  # Write events to disk in CSV format
21
20
  # Write a PI header as the first line in the file
22
21
  # Name file per PI convention, based upon first and last timestamps encountered
23
22
 
24
- class LogStash::Outputs::PICSV < LogStash::Outputs::File
25
-
26
- config_name "picsv"
23
+ class LogStash::Outputs::SCACSV < LogStash::Outputs::File
24
+
25
+ config_name "scacsv"
27
26
  milestone 1
28
27
 
29
28
  # The field names from the event that should be written to the CSV file.
@@ -106,15 +105,15 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
106
105
  private
107
106
  def flushWatchdog(delay)
108
107
  begin
109
- @logger.debug("PICSVFlushWatchdog - Last output time = " + @lastOutputTime.to_s)
108
+ @logger.debug("SCACSVFlushWatchdog - Last output time = " + @lastOutputTime.to_s)
110
109
  while true do
111
- @logger.debug("PICSVFlushWatchdog - Time.now = " + Time.now.to_s + " $lastOutputTime=" + @lastOutputTime.to_s + " delay=" + delay.to_s)
110
+ @logger.debug("SCACSVFlushWatchdog - Time.now = " + Time.now.to_s + " $lastOutputTime=" + @lastOutputTime.to_s + " delay=" + delay.to_s)
112
111
 
113
112
  if ( (Time.now.to_i >= (@lastOutputTime.to_i + delay.to_i)) and (@recordCount > 0)) then
114
- @logger.debug("PICSVFlushWatchdog - closeAndRenameCurrentFile")
113
+ @logger.debug("SCACSVFlushWatchdog - closeAndRenameCurrentFile")
115
114
  closeAndRenameCurrentFile
116
115
  end
117
- @logger.debug("PICSVFlushWatchdog - Sleeping")
116
+ @logger.debug("SCACSVFlushWatchdog - Sleeping")
118
117
  sleep 1
119
118
  end
120
119
  end
@@ -124,7 +123,7 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
124
123
  def receive(event)
125
124
  return unless output?(event)
126
125
 
127
- @logger.debug("in PICSV receive")
126
+ @logger.debug("in SCACSV receive")
128
127
 
129
128
  if (event['SCAWindowMarker'])
130
129
  # just eat the marker - don't output it
@@ -141,7 +140,7 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
141
140
 
142
141
  @formattedPath = event.sprintf(@path)
143
142
  fd = open(@formattedPath)
144
- @logger.debug("PICSVreceive - after opening fd=" + fd.to_s)
143
+ @logger.debug("SCACSVreceive - after opening fd=" + fd.to_s)
145
144
 
146
145
  if @recordCount == 0
147
146
  # output header on first line - note, need a minimum of one record for sensible output
@@ -244,7 +243,7 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
244
243
  begin
245
244
 
246
245
  if timestamp.nil? then
247
- @logger.debug("PICSV " + missingString + " for #{group}")
246
+ @logger.debug("SCACSV " + missingString + " for #{group}")
248
247
  elsif timestamp_output_format == "epoch" then
249
248
  outputString = timestamp.to_s
250
249
  elsif timestamp_output_format == "" then
@@ -354,7 +353,7 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
354
353
  end
355
354
 
356
355
  def teardown
357
- @logger.debug("PICSV - Teardown: closing files")
356
+ @logger.debug("SCACSV - Teardown: closing files")
358
357
 
359
358
  Thread.kill(@timerThread)
360
359
  closeAndRenameCurrentFile
@@ -362,5 +361,5 @@ class LogStash::Outputs::PICSV < LogStash::Outputs::File
362
361
  finished
363
362
  end
364
363
 
365
- end # class LogStash::Outputs::PICSV
364
+ end # class LogStash::Outputs::SCACSV
366
365
 
Binary file
@@ -1,19 +1,17 @@
1
1
  Gem::Specification.new do |s|
2
- s.name = 'logstash-output-picsv'
3
- s.version = "1.0.5.1" # 0921@08:05AM
4
- s.licenses = ["Apache-2.0"]
5
- s.summary = "Receives a stream of events and outputs files meeting the csv format for IBM Operation Analytics Predictive Insights"
2
+ s.name = 'logstash-output-picsv'
3
+ s.version = "1.0.6"
4
+ s.licenses = ["Apache-2.0"]
5
+ s.summary = "Receives a stream of events and outputs files meeting the csv format for IBM Operation Analytics Predictive Insights"
6
6
  # Need to validate 1.5 standalone gemfile compatibility; gemfile exists!
7
- s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
8
- s.authors = ["ORIG:Robert Mckeown, Update:Jim Ray"]
9
- s.email = "raygj@us.ibm.com"
10
- s.homepage = "https://github.com/raygj/logstash-output-picsv/README.md"
11
- s.require_paths = ["lib"]
7
+ s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
8
+ s.authors = ["ORIG:Robert Mckeown, Update:Jim Ray"]
9
+ s.email = "raygj@us.ibm.com"
10
+ s.homepage = "https://github.com/raygj/logstash-output-picsv/README.md"
11
+ s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- # s.files = `git ls-files`.split($\) # original line
15
- s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
16
-
14
+ s.files = `git ls-files`.split($\)
17
15
  # Tests
18
16
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
17
 
@@ -21,9 +19,7 @@ Gem::Specification.new do |s|
21
19
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
22
20
 
23
21
  # Gem dependencies
24
- s.add_runtime_dependency "logstash-core-plugin-api", ">= 1.60", "<= 2.99"
22
+ s.add_runtime_dependency "logstash-core", ">= 1.5.0", "< 3.0.0"
25
23
  s.add_runtime_dependency "logstash-codec-plain"
26
- s.add_runtime_dependency "logstash-output-file"
27
- s.add_development_dependency "logstash-devutils"
28
-
29
- end
24
+ s.add_development_dependency "logstash-devutils", "~> 0"
25
+ end
@@ -1,13 +1,11 @@
1
- # encoding: utf-8
2
- require "logstash/outputs/picsv"
3
1
  require "logstash/devutils/rspec/spec_helper"
2
+ require "logstash/outputs/base" # changed from /example to /base
4
3
  require "logstash/codecs/plain"
5
4
  require "logstash/event"
6
- require "logstash/outputs/file"
7
5
 
8
- describe LogStash::Outputs::PICSV do
6
+ describe LogStash::Outputs::Example do
9
7
  let(:sample_event) { LogStash::Event.new }
10
- let(:output) { LogStash::Outputs::PICSV.new }
8
+ let(:output) { LogStash::Outputs::Example.new }
11
9
 
12
10
  before do
13
11
  output.register
@@ -20,4 +18,4 @@ describe LogStash::Outputs::PICSV do
20
18
  expect(subject).to eq("Event received")
21
19
  end
22
20
  end
23
- end
21
+ end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-picsv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5.1
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ORIG:Robert Mckeown, Update:Jim Ray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '1.60'
19
- - - "<="
18
+ version: 1.5.0
19
+ - - "<"
20
20
  - !ruby/object:Gem::Version
21
- version: '2.99'
22
- name: logstash-core-plugin-api
21
+ version: 3.0.0
22
+ name: logstash-core
23
23
  prerelease: false
24
24
  type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '1.60'
30
- - - "<="
29
+ version: 1.5.0
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '2.99'
32
+ version: 3.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
@@ -47,21 +47,7 @@ dependencies:
47
47
  - !ruby/object:Gem::Dependency
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: '0'
53
- name: logstash-output-file
54
- prerelease: false
55
- type: :runtime
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
- - !ruby/object:Gem::Dependency
62
- requirement: !ruby/object:Gem::Requirement
63
- requirements:
64
- - - ">="
50
+ - - "~>"
65
51
  - !ruby/object:Gem::Version
66
52
  version: '0'
67
53
  name: logstash-devutils
@@ -69,7 +55,7 @@ dependencies:
69
55
  type: :development
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
72
- - - ">="
58
+ - - "~>"
73
59
  - !ruby/object:Gem::Version
74
60
  version: '0'
75
61
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
@@ -78,9 +64,12 @@ executables: []
78
64
  extensions: []
79
65
  extra_rdoc_files: []
80
66
  files:
67
+ - ".gitignore"
81
68
  - Gemfile
82
69
  - README.md
70
+ - Rakefile
83
71
  - lib/logstash/outputs/picsv.rb
72
+ - logstash-output-picsv-1.0.5.gem
84
73
  - logstash-output-picsv.gemspec
85
74
  - spec/outputs/picsv_spec.rb
86
75
  homepage: https://github.com/raygj/logstash-output-picsv/README.md