logstash-output-picsv 1.0.5.1 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile +1 -1
- data/Rakefile +1 -0
- data/lib/logstash/outputs/picsv.rb +17 -18
- data/logstash-output-picsv-1.0.5.gem +0 -0
- data/logstash-output-picsv.gemspec +13 -17
- data/spec/outputs/picsv_spec.rb +4 -6
- metadata +14 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31157d03b1a1a074448e9aa65e94987f0d366036
|
4
|
+
data.tar.gz: e557fb27e6e1dc7b6620ae8ecc993529b0bbb58e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7cff5cbd81a8e1d334dbbeb8b4b17d5c55894c0cbdcee4743f1cb2f61a63c6eebdca289bdd6ac9bd90546cff1ab8f1d0929b39e43d90cdfbb0a8df94438e93a
|
7
|
+
data.tar.gz: abf9350c4c261bb714ce984e0d08c8bd51a3acc7ffadde6e322c0ada93960ea40f2373d373ef2aa26607acc0a956dea0b7317a58a2ac0af200407934ad1c2814
|
data/.gitignore
ADDED
data/Gemfile
CHANGED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "logstash/devutils/rake"
|
@@ -1,29 +1,28 @@
|
|
1
1
|
############################################
|
2
2
|
#
|
3
|
-
#
|
3
|
+
# picsv
|
4
4
|
#
|
5
5
|
# Logstash mediation output for IOA PI
|
6
6
|
#
|
7
7
|
# Version 030815.1 Robert Mckeown
|
8
|
-
# Version 030815.
|
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
|
-
#
|
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::
|
25
|
-
|
26
|
-
config_name "
|
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("
|
108
|
+
@logger.debug("SCACSVFlushWatchdog - Last output time = " + @lastOutputTime.to_s)
|
110
109
|
while true do
|
111
|
-
@logger.debug("
|
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("
|
113
|
+
@logger.debug("SCACSVFlushWatchdog - closeAndRenameCurrentFile")
|
115
114
|
closeAndRenameCurrentFile
|
116
115
|
end
|
117
|
-
@logger.debug("
|
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
|
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("
|
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("
|
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("
|
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::
|
364
|
+
end # class LogStash::Outputs::SCACSV
|
366
365
|
|
Binary file
|
@@ -1,19 +1,17 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
|
-
s.name
|
3
|
-
s.version = "1.0.
|
4
|
-
s.licenses
|
5
|
-
s.summary
|
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
|
8
|
-
s.authors
|
9
|
-
s.email
|
10
|
-
s.homepage
|
11
|
-
s.require_paths
|
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
|
-
|
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
|
22
|
+
s.add_runtime_dependency "logstash-core", ">= 1.5.0", "< 3.0.0"
|
25
23
|
s.add_runtime_dependency "logstash-codec-plain"
|
26
|
-
s.
|
27
|
-
|
28
|
-
|
29
|
-
end
|
24
|
+
s.add_development_dependency "logstash-devutils", "~> 0"
|
25
|
+
end
|
data/spec/outputs/picsv_spec.rb
CHANGED
@@ -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::
|
6
|
+
describe LogStash::Outputs::Example do
|
9
7
|
let(:sample_event) { LogStash::Event.new }
|
10
|
-
let(:output) { LogStash::Outputs::
|
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.
|
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-
|
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:
|
19
|
-
- - "
|
18
|
+
version: 1.5.0
|
19
|
+
- - "<"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
22
|
-
name: logstash-core
|
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:
|
30
|
-
- - "
|
29
|
+
version: 1.5.0
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
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
|