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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62c7c90326f3b048fd6059c9b97067b8033ec918
4
- data.tar.gz: 0fd2c6793585ba90130075bfad296a01339f1611
3
+ metadata.gz: 0b744874cb2fef2219242b4da4b8acd1c020214c
4
+ data.tar.gz: dbd7c2dcbfdf15587a6950966d60755305cf000f
5
5
  SHA512:
6
- metadata.gz: cc4c953e8386b244b09d6797f814036ed410442456269292ec7dad0ad5652ea0294ef089071d76a664dcaaf2cbe1dee1fed1440848db75e8d445545c5a7be911
7
- data.tar.gz: 500b60c32af0408b6e51e87ef0d2346e6aaeace213b447e5a38e4576a7d7a8611e380ed41a3019ea0868a69eee7961fcde680867304c2471c385cf0954cdddc8
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.2.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.2.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-23 00:00:00.000000000 Z
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