logstash-output-timber 1.0.0 → 1.0.1
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 +4 -4
- data/CHANGELOG.md +4 -65
- data/README.md +2 -2
- data/lib/logstash/outputs/timber.rb +8 -2
- data/logstash-output-timber.gemspec +1 -1
- data/spec/outputs/timber_spec.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 876397ec04113baadf58af67a3f152ed8b03c3290984e519b98fda3a3d153e64
|
4
|
+
data.tar.gz: a2faf8c5c07eb1cbdae00b572c77b486e386d164d9f9300bd85b34d3af6edefc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8353f74f4f7d3802be35d728975bec9085a7704e0978d30efb2841a61f5f4a23d573581b3e19753c001ddbe74ce8c98b9a43e840560a098aa6256d6de4b073b2
|
7
|
+
data.tar.gz: aa31ab11e03084c657de88e951180a7e5354748e7424bb996c5055ac65aed888fa53850bdee136bf6d30a3b17dea80a53fcf0c7a5c8e7d4fa0c6e236dd52aab5
|
data/CHANGELOG.md
CHANGED
@@ -1,66 +1,5 @@
|
|
1
|
-
##
|
2
|
-
-
|
1
|
+
## 1.0.1
|
2
|
+
- Drop the @version field since it is not useful to external systems
|
3
3
|
|
4
|
-
##
|
5
|
-
-
|
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
|
-
[](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-
|
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.
|
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(
|
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.
|
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"
|
data/spec/outputs/timber_spec.rb
CHANGED
@@ -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.
|
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(
|
132
|
+
expect(body_event).to eq({"@timestamp"=>timestamp_iso8601, "message"=>"hi"})
|
127
133
|
end
|
128
134
|
|
129
135
|
it "handles fatal request errors" do
|