logstash-output-sumologic 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/{DEVELOPER.md → CONTRIBUTING.md} +42 -22
- data/lib/logstash/outputs/sumologic/monitor.rb +5 -1
- data/lib/logstash/outputs/sumologic/sender.rb +1 -1
- data/lib/logstash/outputs/sumologic.rb +1 -1
- data/logstash-output-sumologic.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab9e1ae438a4d6030629b00a67c0536aba6995f6a2bae1f952b9737cf2c28189
|
4
|
+
data.tar.gz: fdfec75b2d7c4bcd5c242c1d142d041648d450e3dfcb7a576de9531986f5438d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66620931f50b2c241835824e26e16e0c05ef8c4ec9ac5ad3770d579ae345ef4486c68de23de8c7c284e3005598231738f75bef59704977a65e3911b992907951
|
7
|
+
data.tar.gz: 294a5910f5ec91ace98405439411d26ddf1e3c858e6d17cefb67d8b2b3c0b534c101cdd93faeab08c34dd42f77f5fb078e03b853e6937d63b1ed9f56ba69b840
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 1.4.0 (2021-09-27)
|
4
|
+
|
5
|
+
- [#68](https://github.com/SumoLogic/logstash-output-sumologic/pull/68) feat: retry on 502 error code
|
6
|
+
|
3
7
|
## 1.3.2 (2021-02-03)
|
4
8
|
|
5
9
|
- [#60](https://github.com/SumoLogic/logstash-output-sumologic/pull/60) Fix plugin metrics not being sent
|
@@ -1,6 +1,46 @@
|
|
1
|
-
#
|
1
|
+
# Contributing
|
2
2
|
|
3
|
-
|
3
|
+
## Set up development environment
|
4
|
+
|
5
|
+
You can use the preconfigured Vagrant virtual machine for development
|
6
|
+
It includes everything that is needed to start coding.
|
7
|
+
See [./vagrant/README.md](./vagrant/README.md).
|
8
|
+
|
9
|
+
If you don't want to or cannot use Vagrant, you need to install the following dependencies:
|
10
|
+
|
11
|
+
- [Java SE](http://www.oracle.com/technetwork/java/javase/downloads/index.html) as a prerequisite to JRuby,
|
12
|
+
- [JRuby](https://www.jruby.org/),
|
13
|
+
- [Bundler](https://bundler.io/),
|
14
|
+
- optionally [Docker](https://docs.docker.com/get-docker/), if you want to build and run container images.
|
15
|
+
|
16
|
+
When your machine is ready (either in Vagrant or not), run this in the root directory of this repository:
|
17
|
+
|
18
|
+
```sh
|
19
|
+
bundle install
|
20
|
+
```
|
21
|
+
|
22
|
+
## Running tests
|
23
|
+
|
24
|
+
Some of the tests try to send actual data to an actual Sumo Logic account.
|
25
|
+
To run those tests, you need to make `sumo_url` environment variable available.
|
26
|
+
If the `sumo_url` environment variable is not present, the tests reaching Sumo Logic will be skipped.
|
27
|
+
|
28
|
+
```sh
|
29
|
+
export sumo_url=https://events.sumologic.net/receiver/v1/http/XXXXXXXXXX
|
30
|
+
```
|
31
|
+
|
32
|
+
To run the tests, execute:
|
33
|
+
|
34
|
+
```sh
|
35
|
+
bundle exec rspec
|
36
|
+
```
|
37
|
+
|
38
|
+
To run tests in Docker, execute:
|
39
|
+
|
40
|
+
```sh
|
41
|
+
docker build -t logstash-output-plugin .
|
42
|
+
docker run --rm -it -e 'sumo_url=https://events.sumologic.net/receiver/v1/http/XXXXXXXXXX' logstash-output-plugin
|
43
|
+
```
|
4
44
|
|
5
45
|
## How to build .gem file from repository
|
6
46
|
|
@@ -24,26 +64,6 @@ And then install the plugin locally:
|
|
24
64
|
bin/logstash-plugin install <full path of .gem>
|
25
65
|
```
|
26
66
|
|
27
|
-
## How to run test with rspec
|
28
|
-
|
29
|
-
### Running in Docker
|
30
|
-
|
31
|
-
```bash
|
32
|
-
docker build -t logstash-output-plugin .
|
33
|
-
docker run --rm -it -e 'sumo_url=https://events.sumologic.net/receiver/v1/http/XXXXXXXXXX' logstash-output-plugin
|
34
|
-
```
|
35
|
-
|
36
|
-
### Running on bare metal
|
37
|
-
|
38
|
-
The test requires JRuby to run.
|
39
|
-
|
40
|
-
```bash
|
41
|
-
rvm use jruby
|
42
|
-
bundle install
|
43
|
-
export sumo_url=https://events.sumologic.net/receiver/v1/http/XXXXXXXXXX
|
44
|
-
rspec spec/
|
45
|
-
```
|
46
|
-
|
47
67
|
## Continuous Integration
|
48
68
|
|
49
69
|
The project uses GitHub Actions for:
|
@@ -29,7 +29,7 @@ module LogStash; module Outputs; class SumoLogic;
|
|
29
29
|
while @stopping.false?
|
30
30
|
Stud.stoppable_sleep(@interval) { @stopping.true? }
|
31
31
|
if @stats.total_log_lines.value > 0 || @stats.total_metrics_datapoints.value > 0
|
32
|
-
@queue.enq(Batch.new(
|
32
|
+
@queue.enq(Batch.new(headers(), build_stats_payload()))
|
33
33
|
end
|
34
34
|
end # while
|
35
35
|
}
|
@@ -73,5 +73,9 @@ module LogStash; module Outputs; class SumoLogic;
|
|
73
73
|
"metric=#{key} interval=#{@interval} category=monitor #{value} #{timestamp}"
|
74
74
|
end # def build_metric_line
|
75
75
|
|
76
|
+
def headers()
|
77
|
+
@headers ||= @header_builder.build_stats()
|
78
|
+
end
|
79
|
+
|
76
80
|
end
|
77
81
|
end; end; end
|
@@ -125,7 +125,7 @@ module LogStash; module Outputs; class SumoLogic;
|
|
125
125
|
:code => response.code,
|
126
126
|
:headers => headers,
|
127
127
|
:contet => content[0..20])
|
128
|
-
if response.code == 429 || response.code == 503 || response.code == 504
|
128
|
+
if response.code == 429 || response.code == 502 || response.code == 503 || response.code == 504
|
129
129
|
requeue_message(batch)
|
130
130
|
end
|
131
131
|
else
|
@@ -102,7 +102,7 @@ class LogStash::Outputs::SumoLogic < LogStash::Outputs::Base
|
|
102
102
|
# For carbon2 metrics format only, define the meta tags (which will NOT be used to identify the metrics)
|
103
103
|
config :meta_tags, :validate => :hash, :default => {}
|
104
104
|
|
105
|
-
# For messages fail to send or get 429/503/504 response, try to resend after (x) seconds; don't resend if (x) < 0
|
105
|
+
# For messages fail to send or get 429/502/503/504 response, try to resend after (x) seconds; don't resend if (x) < 0
|
106
106
|
config :sleep_before_requeue, :validate => :number, :default => 30
|
107
107
|
|
108
108
|
config :stats_category, :validate => :string, :default => CATEGORY_HEADER_DEFAULT_STATS
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-sumologic'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.4.0'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Deliever the log to Sumo Logic cloud service.'
|
6
6
|
s.description = 'This gem is a Logstash output plugin to deliver the log or metrics to Sumo Logic cloud service. Go to https://github.com/SumoLogic/logstash-output-sumologic for getting help, reporting issues, etc.'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-sumologic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sumo Logic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: manticore
|
@@ -107,7 +107,7 @@ extensions: []
|
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
109
|
- CHANGELOG.md
|
110
|
-
-
|
110
|
+
- CONTRIBUTING.md
|
111
111
|
- Gemfile
|
112
112
|
- LICENSE
|
113
113
|
- README.md
|