logstash-output-http 4.1.0 → 4.2.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 +2 -0
- data/lib/logstash/outputs/http.rb +11 -17
- data/logstash-output-http.gemspec +1 -2
- data/spec/outputs/http_spec.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b4a026e5f3a42c48d00794b751d1611669b3e40
|
4
|
+
data.tar.gz: d0dc53c6a6dbc21e76e0cf9f949e2999aeea4eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04740829ac241f0f35cb36a199e84d31a27ac20764af5bdcb2ed496d6deb1b34f949579a984447de2f57b808eb130b1673a2a748c99965f2f43aa7d926cdf965
|
7
|
+
data.tar.gz: ecd0e6c6dce00ecc73b3b7d85a476a8384eddeb6f659495c8e18cd75f294d750e9b4c37b5125193017006f7c9ab0e97f005355f027874083405542416bf80371
|
data/CHANGELOG.md
CHANGED
@@ -305,29 +305,23 @@ class LogStash::Outputs::Http < LogStash::Outputs::Base
|
|
305
305
|
end
|
306
306
|
end
|
307
307
|
|
308
|
-
def
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
acc[k] =
|
313
|
-
|
314
|
-
acc[k] = event.sprintf(v)
|
308
|
+
def convert_mapping(mapping, event)
|
309
|
+
if mapping.is_a?(Hash)
|
310
|
+
mapping.reduce({}) do |acc, kv|
|
311
|
+
k, v = kv
|
312
|
+
acc[k] = convert_mapping(v, event)
|
313
|
+
acc
|
315
314
|
end
|
316
|
-
|
315
|
+
elsif mapping.is_a?(Array)
|
316
|
+
mapping.map { |elem| convert_mapping(elem, event) }
|
317
|
+
else
|
318
|
+
event.sprintf(mapping)
|
317
319
|
end
|
318
320
|
end
|
319
321
|
|
320
322
|
def map_event(event)
|
321
323
|
if @mapping
|
322
|
-
@mapping
|
323
|
-
k,v = kv
|
324
|
-
if v.is_a?(Hash)
|
325
|
-
acc[k] = reduce_hash(v, event)
|
326
|
-
else
|
327
|
-
acc[k] = event.sprintf(v)
|
328
|
-
end
|
329
|
-
acc
|
330
|
-
end
|
324
|
+
convert_mapping(@mapping, event)
|
331
325
|
else
|
332
326
|
event.to_hash
|
333
327
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
|
-
|
3
2
|
s.name = 'logstash-output-http'
|
4
|
-
s.version = '4.
|
3
|
+
s.version = '4.2.0'
|
5
4
|
s.licenses = ['Apache License (2.0)']
|
6
5
|
s.summary = "This output lets you `PUT` or `POST` events to a generic HTTP(S) endpoint"
|
7
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/http_spec.rb
CHANGED
@@ -287,7 +287,10 @@ describe LogStash::Outputs::Http do
|
|
287
287
|
"host" => "X %{foo}",
|
288
288
|
"event" => {
|
289
289
|
"user" => "Y %{user}"
|
290
|
-
}
|
290
|
+
},
|
291
|
+
"arrayevent" => [{
|
292
|
+
"user" => "Z %{user}"
|
293
|
+
}]
|
291
294
|
}
|
292
295
|
}
|
293
296
|
}
|
@@ -296,7 +299,10 @@ describe LogStash::Outputs::Http do
|
|
296
299
|
"host" => "X #{event.get("foo")}",
|
297
300
|
"event" => {
|
298
301
|
"user" => "Y #{event.get("user")}"
|
299
|
-
}
|
302
|
+
},
|
303
|
+
"arrayevent" => [{
|
304
|
+
"user" => "Z #{event.get("user")}"
|
305
|
+
}]
|
300
306
|
})
|
301
307
|
}
|
302
308
|
let(:expected_content_type) { "application/json" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|