logstash-output-influxdb2 0.3.0 → 0.4.0
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 -0
- data/lib/logstash/outputs/influxdb2.rb +3 -3
- data/logstash-output-influxdb2.gemspec +1 -1
- data/spec/outputs/influxdb2_spec.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dfd75d3189d4c6d414de1de45c4bc1cc238edab17b80c46f5854b69d40bf2a2
|
4
|
+
data.tar.gz: 016e508f44b388e632fa97a06fb8643691083b174495261305e48285d645da27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dc471f8845297d388f0cec6954da91b4d43149119df5bc5fa6c1a92fb3be740b523352728a95acf4f01159d95d0b21c0c3494dfacceb7219eed1593f9bf8abc
|
7
|
+
data.tar.gz: 3841350260e5bb965517caa45ce513a047dd6ec3046f0ff54c3e7703709158c3c5fd6eef4aef01297c9d22feeaaa7a963d15783941f93d43ac3eb9156f4e4b72
|
data/CHANGELOG.md
CHANGED
@@ -14,7 +14,7 @@ class LogStash::Outputs::InfluxDB2 < LogStash::Outputs::Base
|
|
14
14
|
config :write_options, :validate => :hash, :default => {}
|
15
15
|
|
16
16
|
config :measurement, :validate => :string, :required => true
|
17
|
-
config :tags, :validate => :string
|
17
|
+
config :tags, :validate => :string
|
18
18
|
config :fields, :validate => :string, :required => true
|
19
19
|
|
20
20
|
config :escape_value, :validate => :boolean, :default => false
|
@@ -30,9 +30,9 @@ class LogStash::Outputs::InfluxDB2 < LogStash::Outputs::Base
|
|
30
30
|
public
|
31
31
|
def receive(event)
|
32
32
|
fields = event.get(@fields)
|
33
|
-
return unless fields.is_a?(Hash) && fields.
|
33
|
+
return unless fields.is_a?(Hash) && ! fields.empty?
|
34
34
|
|
35
|
-
tags = event.get(@tags)
|
35
|
+
tags = @tags.nil? ? nil : event.get(@tags)
|
36
36
|
return unless tags.nil? || tags.is_a?(Hash)
|
37
37
|
|
38
38
|
unless @escape_value
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-influxdb2'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.4.0'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Writes metrics to InfluxDB 2.x'
|
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'
|
@@ -14,7 +14,6 @@ describe LogStash::Outputs::InfluxDB2 do
|
|
14
14
|
"url" => "http://localhost:8086",
|
15
15
|
"token" => "token123",
|
16
16
|
"measurement" => "%{[kubernetes][labels][app]}",
|
17
|
-
"tags" => "[prometheus][labels]",
|
18
17
|
"fields" => "[prometheus][metrics]"
|
19
18
|
}
|
20
19
|
end
|
@@ -56,7 +55,7 @@ describe LogStash::Outputs::InfluxDB2 do
|
|
56
55
|
expect(write_options.batch_abort_on_exception).to be false
|
57
56
|
|
58
57
|
expect(subject.instance_variable_get(:@measurement)).to eq "%{[kubernetes][labels][app]}"
|
59
|
-
expect(subject.instance_variable_get(:@tags)).to
|
58
|
+
expect(subject.instance_variable_get(:@tags)).to be_nil
|
60
59
|
expect(subject.instance_variable_get(:@fields)).to eq "[prometheus][metrics]"
|
61
60
|
expect(subject.instance_variable_get(:@escape_value)).to be false
|
62
61
|
end
|
@@ -332,8 +331,8 @@ describe LogStash::Outputs::InfluxDB2 do
|
|
332
331
|
"@timestamp" => "2020-01-01T00:00:00Z",
|
333
332
|
"kubernetes" => { "labels" => { "app" => "dummy" } },
|
334
333
|
"prometheus" => {
|
335
|
-
"metrics" => { "count" => 123.0 }
|
336
334
|
# Valid: no labels!
|
335
|
+
"metrics" => { "count" => 123.0 }
|
337
336
|
}
|
338
337
|
))
|
339
338
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-influxdb2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Issey Yamakoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|