logstash-output-timber 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 8bf83aa2d2c4239a019db421f39fe16b87f0ede8613a6126b9d8ce7aa17742f9
4
- data.tar.gz: 29ab8df17494515feec2301af889b2ec5d277564ae2594ce03f965dc4413d8ba
3
+ metadata.gz: 876397ec04113baadf58af67a3f152ed8b03c3290984e519b98fda3a3d153e64
4
+ data.tar.gz: a2faf8c5c07eb1cbdae00b572c77b486e386d164d9f9300bd85b34d3af6edefc
5
5
  SHA512:
6
- metadata.gz: 02b47b2a374880b263f0fbbb733b363785ade764cee499e226eda5ccc4b66b163b9bea50f5ff741d439962ea30ba6e1b3700a5ff64113d9006a231f974ac6f68
7
- data.tar.gz: 74d986e655bddaf3d3008221fb01abb7c1c82ea272c3289ea303d651e739e13298c740a5cd747ed2949bd95058ade00bd9938f9900d0c30f02a4b2a022825bcf
6
+ metadata.gz: 8353f74f4f7d3802be35d728975bec9085a7704e0978d30efb2841a61f5f4a23d573581b3e19753c001ddbe74ce8c98b9a43e840560a098aa6256d6de4b073b2
7
+ data.tar.gz: aa31ab11e03084c657de88e951180a7e5354748e7424bb996c5055ac65aed888fa53850bdee136bf6d30a3b17dea80a53fcf0c7a5c8e7d4fa0c6e236dd52aab5
@@ -1,66 +1,5 @@
1
- ## 4.3.3
2
- - Docs: Add plugin description.
1
+ ## 1.0.1
2
+ - Drop the @version field since it is not useful to external systems
3
3
 
4
- ## 4.3.2
5
- - Docs: Update plugin title.
6
-
7
- ## 4.3.1
8
- - Fix deadlock that could occur in certain situations. All users should upgrade to the latest version.
9
- This deadlock was caused by certain async HTTP APIs being called out of order thus creating a race.
10
-
11
- ## 4.3.0
12
- - Add `user` and `password` options to support HTTP basic auth
13
-
14
- ## 4.2.0
15
- - Allow nested array in field definition, See https://github.com/logstash-plugins/logstash-output-http/pull/53
16
-
17
- ## 4.1.0
18
- - Allow nested field definitions in `mappings`
19
-
20
- ## 4.0.0
21
- - Major overhaul of internals, adds new retry options
22
- - Allow users to specify non-standard response codes as ignorable
23
- - Set concurrency level to shared allowing for greater efficiency across threads
24
-
25
- ## 3.1.1
26
- - Relax constraint on logstash-core-plugin-api to >= 1.60 <= 2.99
27
-
28
- ## 3.1.0
29
- - breaking,config: Remove deprecated config 'verify_ssl'. Please use 'ssl_certificate_validation'.
30
-
31
- ## 3.0.1
32
- - Republish all the gems under jruby.
33
-
34
- ## 3.0.0
35
- - 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
36
-
37
- ## 2.1.3
38
- - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
39
-
40
- ## 2.1.2
41
- - New dependency requirements for logstash-core for the 5.0 release
42
-
43
- ## 2.1.1
44
- - Require http_client mixin with better keepalive handling
45
-
46
-
47
- ## 2.1.0
48
- - Properly close the client on #close
49
- - Optimized execution for Logstash 2.2 ng pipeline
50
-
51
- ## 2.0.5
52
- - fixed memory leak
53
-
54
- ## 2.0.3
55
- - fixed potential race condition on async callbacks
56
- - silenced specs equest logs and other spec robustness fixes
57
-
58
- ## 2.0.0
59
- - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
60
- instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
61
- - Dependency on logstash-core update to 2.0
62
-
63
- ## 1.1.0
64
- - Concurrent execution
65
- - Add many HTTP options via the http_client mixin
66
- - Switch to manticore as HTTP Client
4
+ ## 1.0.0
5
+ - Initial release
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-output-http.svg)](https://travis-ci.org/logstash-plugins/logstash-output-http)
3
+ [![Travis Build Status](https://travis-ci.org/timberio/logstash-output-timber.svg)](https://travis-ci.org/timberio/logstash-output-timber)
4
4
 
5
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
6
6
 
@@ -74,7 +74,7 @@ You can use the same **2.1** method to run your plugin in an installed Logstash
74
74
 
75
75
  - Build your plugin gem
76
76
  ```sh
77
- gem build logstash-output-http.gemspec
77
+ gem build logstash-output-timber.gemspec
78
78
  ```
79
79
  - Install the plugin from the Logstash home
80
80
  ```sh
@@ -13,7 +13,7 @@ require "logstash/outputs/timber/http_client"
13
13
  class LogStash::Outputs::Timber < LogStash::Outputs::Base
14
14
  include HttpClient
15
15
 
16
- VERSION = "1.0.0".freeze
16
+ VERSION = "1.0.1".freeze
17
17
  CONTENT_TYPE = "application/json".freeze
18
18
  MAX_ATTEMPTS = 3
19
19
  METHOD = :post.freeze
@@ -79,7 +79,7 @@ class LogStash::Outputs::Timber < LogStash::Outputs::Base
79
79
 
80
80
  response =
81
81
  begin
82
- hash_events = events.collect(&:to_hash)
82
+ hash_events = events.collect { |e| event_hash(e) }
83
83
  body = LogStash::Json.dump(hash_events)
84
84
  http_client.post(@url, :body => body, :headers => @headers)
85
85
  rescue Exception => e
@@ -127,6 +127,12 @@ class LogStash::Outputs::Timber < LogStash::Outputs::Base
127
127
  end
128
128
  end
129
129
 
130
+ def event_hash(e)
131
+ hash = e.to_hash
132
+ hash.delete("@version")
133
+ hash
134
+ end
135
+
130
136
  def retryable_exception?(e)
131
137
  RETRYABLE_MANTICORE_EXCEPTIONS.any? do |exception_class|
132
138
  e.is_a?(exception_class)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-timber'
3
- s.version = "1.0.0"
3
+ s.version = "1.0.1"
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "This output send events to the Timber.io logging service"
6
6
  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"
@@ -1,7 +1,9 @@
1
+ require "json"
2
+ require "thread"
3
+
1
4
  require "logstash/devutils/rspec/spec_helper"
2
5
  require "logstash/outputs/timber"
3
6
  require "logstash/codecs/plain"
4
- require "thread"
5
7
  require "sinatra"
6
8
 
7
9
  PORT = rand(65535-1024) + 1025
@@ -120,10 +122,14 @@ describe LogStash::Outputs::Timber do
120
122
  request = requests.first
121
123
  expect(request.env["CONTENT_TYPE"]).to eq("application/json")
122
124
  expect(request.env["HTTP_AUTHORIZATION"]).to eq("Basic MTIzOmFiY2QxMjM0")
123
- expect(request.env["HTTP_USER_AGENT"]).to eq("Timber Logstash/1.0.0")
125
+ expect(request.env["HTTP_USER_AGENT"]).to eq("Timber Logstash/1.0.1")
126
+
127
+ parsed_body = JSON.parse!(request.body.read)
128
+ expect(parsed_body.length).to eq(1)
124
129
 
130
+ body_event = parsed_body.first
125
131
  timestamp_iso8601 = event.get("@timestamp").to_iso8601
126
- expect(request.body.read).to eq("[{\"@timestamp\":\"#{timestamp_iso8601}\",\"@version\":\"1\",\"message\":\"hi\"}]")
132
+ expect(body_event).to eq({"@timestamp"=>timestamp_iso8601, "message"=>"hi"})
127
133
  end
128
134
 
129
135
  it "handles fatal request errors" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-timber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic