logstash-input-signalsciences 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/signalsciences.rb +7 -0
- data/logstash-input-signalsciences.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b744874cb2fef2219242b4da4b8acd1c020214c
|
4
|
+
data.tar.gz: dbd7c2dcbfdf15587a6950966d60755305cf000f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa034dd52a451d4848aef3a6df21cbc8529770fa72daab4889a7360a5d60c0938ac12a0a9ed8f47846b92a9f1b68187594bb293179a6ba21ef439c08e03461e
|
7
|
+
data.tar.gz: 869477e185a203ef8e8c5f07374fc631412bf08d14e4b84ad29694f7ccd03b18a90656225bedc5efa12d9c3f0cd7ac10c1595049b29305429c63274064c763ef
|
@@ -5,6 +5,7 @@ require "stud/interval"
|
|
5
5
|
require "socket" # for Socket.gethostname
|
6
6
|
require "json"
|
7
7
|
require "date"
|
8
|
+
require "rubygems"
|
8
9
|
|
9
10
|
# Fetch Signal Sciences request data.
|
10
11
|
#
|
@@ -55,12 +56,17 @@ class LogStash::Inputs::Signalsciences < LogStash::Inputs::Base
|
|
55
56
|
# set interval to value of from @from minus five minutes
|
56
57
|
@interval = @from
|
57
58
|
|
59
|
+
# get version for UA string
|
60
|
+
spec = Gem::Specification::load("logstash-input-signalsciences.gemspec")
|
61
|
+
@version = spec.version
|
62
|
+
|
58
63
|
@logger.info("Fetching Signal Sciences request data every #{@interval / 60} minutes.")
|
59
64
|
end # def register
|
60
65
|
|
61
66
|
def run(queue)
|
62
67
|
# we can abort the loop if stop? becomes true
|
63
68
|
while !stop?
|
69
|
+
@login['User-Agent'] = "logstash-signalsciences/#{@version}"
|
64
70
|
@login.body = URI.encode_www_form({"email" => @email, "password" => @password})
|
65
71
|
|
66
72
|
if fetch(queue)
|
@@ -118,6 +124,7 @@ class LogStash::Inputs::Signalsciences < LogStash::Inputs::Base
|
|
118
124
|
# Loop through results until next_uri is empty.
|
119
125
|
while !next_uri.empty?
|
120
126
|
get["Authorization"] = "Bearer #{token}"
|
127
|
+
get['User-Agent'] = "logstash-signalsciences/#{@version}"
|
121
128
|
|
122
129
|
begin
|
123
130
|
response = @http.request(get)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-signalsciences'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.3.0'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Logstash input plugin for Signal Sciences.'
|
6
6
|
s.description = 'Logstash input plugin for the Signal Sciences request feed endpoint https://docs.signalsciences.net/api/#get-request-feed'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-signalsciences
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- foospidy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|