logstash-input-http 3.10.10-java → 3.11.0-java
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 +6 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/docs/index.asciidoc +35 -0
- data/lib/logstash/inputs/http.rb +8 -0
- data/lib/logstash-input-http_jars.rb +1 -1
- data/spec/inputs/http_spec.rb +44 -31
- data/vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.11.0/logstash-input-http-3.11.0.jar +0 -0
- metadata +3 -3
- data/vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.10.10/logstash-input-http-3.10.10.jar +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53d4010498cef37711a3510964978b4976d44a6d90df48a5e0d4b449c4c41f1b
|
|
4
|
+
data.tar.gz: 0eb2c879fca5fe8df5712a4473c5fcfa073fc8d9089658e8b0563f8e3d4d4f1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e3b6c7260038efc0a58d9319812f902bf4f198cd1d92fcd5c5584e11fd2af3a9d9854a075a494237f98f7d0d286bf11fc3c1876f46b26246bd71ab90eecb1533
|
|
7
|
+
data.tar.gz: 5df99103b34fd6848355532f1e4beeb70a669fb975966ccc4ccd9e39dc11c35c1a40d202a3f6b30953c3f816ac881d36820530afb4c7060ba2498ce03e3e653d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 3.11.0
|
|
2
|
+
- Implements a functionality to log HTTP traffic, disabled by default. To unable switch on debug logs. [#237](https://github.com/logstash-plugins/logstash-input-http/pull/237)
|
|
3
|
+
|
|
4
|
+
## 3.10.11
|
|
5
|
+
- Fix to use the `Content-type` declared charset to decode the request body [#232](https://github.com/logstash-plugins/logstash-input-http/pull/232)
|
|
6
|
+
|
|
1
7
|
## 3.10.10
|
|
2
8
|
- Update Netty dependency to 4.1.136.Final [#229](https://github.com/logstash-plugins/logstash-input-http/pull/229)
|
|
3
9
|
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Logstash Plugin
|
|
2
2
|
|
|
3
|
-
[](https://github.com/logstash-plugins/logstash-input-http/actions/workflows/unit-tests.yml)
|
|
4
4
|
|
|
5
5
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
|
6
6
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.
|
|
1
|
+
3.11.0
|
data/docs/index.asciidoc
CHANGED
|
@@ -27,6 +27,14 @@ Logstash will convert it into an event for subsequent processing. Users
|
|
|
27
27
|
can pass plain text, JSON, or any formatted data and use a corresponding codec with this
|
|
28
28
|
input. For Content-Type `application/json` the `json` codec is used, but for all other
|
|
29
29
|
data formats, `plain` codec is used.
|
|
30
|
+
If the `Content-type` header also defines a charset like in:
|
|
31
|
+
|
|
32
|
+
[source,text]
|
|
33
|
+
-----
|
|
34
|
+
curl -X POST -H 'Content-Type: application/json; charset=ISO-8859-1'
|
|
35
|
+
-----
|
|
36
|
+
|
|
37
|
+
then that charset is used to decode the request body. Else UTF-8 is applied.
|
|
30
38
|
|
|
31
39
|
This input can also be used to receive webhook requests to integrate with other services
|
|
32
40
|
and applications. By taking advantage of the vast plugin ecosystem available in Logstash
|
|
@@ -82,6 +90,33 @@ Values in `additional_codecs` are prioritized over those specified in the
|
|
|
82
90
|
`codec` option. That is, the default `codec` is applied only if no codec
|
|
83
91
|
for the request's content-type is found in the `additional_codecs` setting.
|
|
84
92
|
|
|
93
|
+
[id="plugins-{type}s-{plugin}-wire-logging"]
|
|
94
|
+
==== Enable wire logging
|
|
95
|
+
This plugin could log all requests and responses passing through the socket after TLS decoding.
|
|
96
|
+
This functionality helps troubleshoot issues in the processing pipeline that standard
|
|
97
|
+
external traffic captures, such as `tcpdump`, cannot resolve.
|
|
98
|
+
By default it's disabled, to dump received and sent payloads post-TLS decoding, enable debug logging
|
|
99
|
+
for `org.logstash.plugins.inputs.http.util.WireLogger`.
|
|
100
|
+
Note: Payloads exceeding 4 KB are automatically truncated to prevent excessive log file growth.
|
|
101
|
+
If you want to set a different limit, then in {ls} `config/jvm.options` configure a value for the system property `logstash.httpinput.wire.dump.size`.
|
|
102
|
+
|
|
103
|
+
[source,text]
|
|
104
|
+
-----
|
|
105
|
+
-Dlogstash.httpinput.wire.dump.size=512
|
|
106
|
+
-----
|
|
107
|
+
If you want to remove any limit, at the risk of polluting {ls} logs, set it to `0`.
|
|
108
|
+
Admitted values are only integers greater or equals to 0.
|
|
109
|
+
|
|
110
|
+
To enable it start {ls} in debug mode or configure the `config/log4j2.properties` to include:
|
|
111
|
+
|
|
112
|
+
[source,text]
|
|
113
|
+
-----
|
|
114
|
+
logger.httpwire.name = org.logstash.plugins.inputs.http.util.WireLogger
|
|
115
|
+
logger.httpwire.level = DEBUG
|
|
116
|
+
-----
|
|
117
|
+
|
|
118
|
+
WARNING: when this log is enabled the payload is dumped, so if contains secretes those are exposed in {ls} logs.
|
|
119
|
+
|
|
85
120
|
[id="plugins-{type}s-{plugin}-options"]
|
|
86
121
|
==== Http Input Configuration Options
|
|
87
122
|
|
data/lib/logstash/inputs/http.rb
CHANGED
|
@@ -204,6 +204,8 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
204
204
|
|
|
205
205
|
validate_ssl_settings!
|
|
206
206
|
|
|
207
|
+
validate_dump_size_system_property!
|
|
208
|
+
|
|
207
209
|
if @user && @password
|
|
208
210
|
token = Base64.strict_encode64("#{@user}:#{@password.value}")
|
|
209
211
|
@auth_token = "Basic #{token}"
|
|
@@ -297,6 +299,12 @@ class LogStash::Inputs::Http < LogStash::Inputs::Base
|
|
|
297
299
|
[http_host, nil]
|
|
298
300
|
end
|
|
299
301
|
end
|
|
302
|
+
|
|
303
|
+
def validate_dump_size_system_property!
|
|
304
|
+
java_import org.logstash.plugins.inputs.http.util.WireLogger
|
|
305
|
+
WireLogger.validate_dump_size_property
|
|
306
|
+
end
|
|
307
|
+
private :validate_dump_size_system_property!
|
|
300
308
|
|
|
301
309
|
def validate_ssl_settings!
|
|
302
310
|
ssl_config_name = original_params.include?('ssl') ? 'ssl' : 'ssl_enabled'
|
|
@@ -9,4 +9,4 @@ require_jar('io.netty', 'netty-transport', '4.1.136.Final')
|
|
|
9
9
|
require_jar('io.netty', 'netty-buffer', '4.1.136.Final')
|
|
10
10
|
require_jar('io.netty', 'netty-resolver', '4.1.136.Final')
|
|
11
11
|
require_jar('io.netty', 'netty-common', '4.1.136.Final')
|
|
12
|
-
require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.
|
|
12
|
+
require_jar('org.logstash.plugins.input.http', 'logstash-input-http', '3.11.0')
|
data/spec/inputs/http_spec.rb
CHANGED
|
@@ -11,6 +11,17 @@ require 'inputs/helpers'
|
|
|
11
11
|
|
|
12
12
|
java_import "io.netty.handler.ssl.util.SelfSignedCertificate"
|
|
13
13
|
|
|
14
|
+
shared_examples "decodes message with charset" do |charset|
|
|
15
|
+
let(:headers) { { "content-type" => "application/json; charset=#{charset}" } }
|
|
16
|
+
let(:body) { '{"msg":"A Coruña"}'.encode(charset) }
|
|
17
|
+
|
|
18
|
+
it "should decode the message accordingly" do
|
|
19
|
+
client.post("http://127.0.0.1:#{port}/meh.json", :headers => headers, :body => body).call
|
|
20
|
+
event = logstash_queue.pop
|
|
21
|
+
expect(event.get("msg")).to eq("A Coruña")
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
14
25
|
describe LogStash::Inputs::Http do
|
|
15
26
|
|
|
16
27
|
before do
|
|
@@ -44,50 +55,42 @@ describe LogStash::Inputs::Http do
|
|
|
44
55
|
end
|
|
45
56
|
|
|
46
57
|
describe "handling overflowing requests with a 429" do
|
|
47
|
-
let(:logstash_queue_size) {
|
|
48
|
-
let(:max_pending_requests) {
|
|
49
|
-
let(:threads) {
|
|
58
|
+
let(:logstash_queue_size) { 1 }
|
|
59
|
+
let(:max_pending_requests) { 1 }
|
|
60
|
+
let(:threads) { 1 }
|
|
50
61
|
let(:logstash_queue) { SizedQueue.new(logstash_queue_size) }
|
|
51
62
|
let(:client_options) { {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
request_timeout: 5,
|
|
64
|
+
connect_timeout: 3,
|
|
65
|
+
socket_timeout: 0.5
|
|
55
66
|
} }
|
|
56
67
|
|
|
57
68
|
let(:config) { { "port" => port, "threads" => threads, "max_pending_requests" => max_pending_requests } }
|
|
58
69
|
|
|
59
70
|
context "when sending more requests than queue slots" do
|
|
60
71
|
it "rejects additional incoming requests with HTTP 429" do
|
|
61
|
-
#
|
|
62
|
-
logstash_queue_size.times
|
|
72
|
+
# fill the pipeline queue so the next push blocks the server worker
|
|
73
|
+
logstash_queue_size.times do
|
|
63
74
|
response = client.post("http://127.0.0.1:#{port}", :body => '{}').call
|
|
64
75
|
expect(response.code).to eq(200)
|
|
65
76
|
end
|
|
66
77
|
|
|
67
|
-
#
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
# a blocked request holds its slot even after the client times out, so sending
|
|
79
|
+
# sequentially fills every worker and backlog slot before the next 429
|
|
80
|
+
blocked = 0
|
|
81
|
+
response = nil
|
|
82
|
+
deadline = Time.now + 30
|
|
83
|
+
until response && response.code == 429
|
|
84
|
+
raise "server never returned 429 (blocked=#{blocked})" if Time.now > deadline
|
|
85
|
+
begin
|
|
86
|
+
response = client.post("http://127.0.0.1:#{port}", :body => '{}').call
|
|
87
|
+
rescue Manticore::SocketTimeout
|
|
88
|
+
blocked += 1
|
|
75
89
|
end
|
|
76
90
|
end
|
|
77
91
|
|
|
78
|
-
sleep 1 # let those requests go, but not so long that our block-detector starts emitting 429's
|
|
79
|
-
|
|
80
|
-
# by now we should be rejecting with 429 since the backlog is full
|
|
81
|
-
response = client.post("http://127.0.0.1:#{port}", :body => '{}').call
|
|
82
92
|
expect(response.code).to eq(429)
|
|
83
|
-
|
|
84
|
-
# ensure that our blocked connections did block
|
|
85
|
-
aggregate_failures do
|
|
86
|
-
blocked_calls.map(&:value).each do |blocked|
|
|
87
|
-
expect(blocked[:result]).to be_nil
|
|
88
|
-
expect(blocked[:exception]).to be_a_kind_of Manticore::SocketTimeout
|
|
89
|
-
end
|
|
90
|
-
end
|
|
93
|
+
expect(blocked).to eq(threads + max_pending_requests)
|
|
91
94
|
end
|
|
92
95
|
end
|
|
93
96
|
end
|
|
@@ -98,9 +101,9 @@ describe LogStash::Inputs::Http do
|
|
|
98
101
|
let(:threads) { rand(4) + 1 }
|
|
99
102
|
let(:logstash_queue) { SizedQueue.new(logstash_queue_size) }
|
|
100
103
|
let(:client_options) { {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
request_timeout: 5,
|
|
105
|
+
connect_timeout: 3,
|
|
106
|
+
socket_timeout: 1
|
|
104
107
|
} }
|
|
105
108
|
|
|
106
109
|
let(:config) { { "port" => port, "threads" => threads, "max_pending_requests" => max_pending_requests } }
|
|
@@ -209,6 +212,16 @@ describe LogStash::Inputs::Http do
|
|
|
209
212
|
expect(event.get("message_body")).to eq("Hello")
|
|
210
213
|
end
|
|
211
214
|
end
|
|
215
|
+
|
|
216
|
+
context "when receiving a request with content-type specifying charset" do
|
|
217
|
+
context "ISO-8859-1" do
|
|
218
|
+
it_behaves_like "decodes message with charset", "ISO-8859-1"
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
context "UTF-8" do
|
|
222
|
+
it_behaves_like "decodes message with charset", "utf-8"
|
|
223
|
+
end
|
|
224
|
+
end
|
|
212
225
|
end
|
|
213
226
|
|
|
214
227
|
context "with json codec" do
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logstash-input-http
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.11.0
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Elastic
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-08-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: logstash-core-plugin-api
|
|
@@ -176,7 +176,7 @@ files:
|
|
|
176
176
|
- vendor/jar-dependencies/io/netty/netty-resolver/4.1.136.Final/netty-resolver-4.1.136.Final.jar
|
|
177
177
|
- vendor/jar-dependencies/io/netty/netty-transport-native-unix-common/4.1.136.Final/netty-transport-native-unix-common-4.1.136.Final.jar
|
|
178
178
|
- vendor/jar-dependencies/io/netty/netty-transport/4.1.136.Final/netty-transport-4.1.136.Final.jar
|
|
179
|
-
- vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.
|
|
179
|
+
- vendor/jar-dependencies/org/logstash/plugins/input/http/logstash-input-http/3.11.0/logstash-input-http-3.11.0.jar
|
|
180
180
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
|
181
181
|
licenses:
|
|
182
182
|
- Apache License (2.0)
|