logstash-input-elastic_serverless_forwarder 0.1.0-java → 0.1.1-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4d67fef66d28e6061c6564ff483239a041daad1d220d19a21767f77fa5a0c5f
4
- data.tar.gz: d9711d462cae094b59bf056d485658e04418bea487cd7569c264e1c2b84d297e
3
+ metadata.gz: 0e68d73969ef8dec415c74ce755da13dfa6bad59c99c239e439b5edafd856ea8
4
+ data.tar.gz: e3d07f9b40953bf1e44b0f26a63beef226aac28bf03b05286e0e90b67ebe60ce
5
5
  SHA512:
6
- metadata.gz: 1b68f3edbb97a521f726df53e48f1906b5e5d27e275c03557fe15239246be400a6185de4eccfa85949276b01921a52ba5b022e7e9779284fefb47b834d00602d
7
- data.tar.gz: b9f3c4a58eed62050a387f6d5008b74000bd336c0e8f1d76e7c4352d57d48e3b759a85479170d61663e57c7e8d2033441db71cd2f4613445f2e08a1c71660e39
6
+ metadata.gz: 8ff5d1b69d172f1293db93a316515779dd68875425b514517ae94edb9f807b5705a40cfeff2b4d613e62b497401a074695ca7abbe65ded013906aad1bbbca459
7
+ data.tar.gz: abf8b62a5135fc746a38709d43252e9447faae8c10d8c8e434bf70034fe9bdc13e76c346046cd58e6a37dc9728a0126c50dbae07c1ec27b245b4b352367ab5e7
data/CHANGELOG.md CHANGED
@@ -1,2 +1,5 @@
1
+ ## 0.1.1
2
+ - Fixes an issue that prevents this prototype from being instantiated in an actual Logstash pipeline [#3](https://github.com/logstash-plugins/logstash-input-elastic_serverless_forwarder/pull/3)
3
+
1
4
  ## 0.1.0
2
5
  - Working Prototype: New input to receive events from Elastic Serverless Forwarder (ESF) over HTTP(S) [#1](https://github.com/logstash-plugins/logstash-input-elastic_serverless_forwarder/pull/1)
data/docs/index.asciidoc CHANGED
@@ -33,25 +33,25 @@ Using this input you can receive events from {esf-name} over http(s) connections
33
33
 
34
34
  |
35
35
 
36
- [source,subs="+macros,attributes"]
36
+ [source]
37
37
  ----
38
38
  input {
39
- {plugin} {
40
- <<plugins-{type}s-{plugin}-port,port>> => 8080
41
- <<plugins-{type}s-{plugin}-ssl_certificate,ssl_certificate>> => "/path/to/logstash.crt"
42
- <<plugins-{type}s-{plugin}-ssl_key,ssl_key>> => "/path/to/logstash.key"
39
+ elastic_serverless_forwarder {
40
+ port => 8080
41
+ ssl_certificate => "/path/to/logstash.crt"
42
+ ssl_key => "/path/to/logstash.key"
43
43
  }
44
44
  }
45
45
  ----
46
46
 
47
47
  |
48
48
 
49
- [source,subs="+macros,attributes"]
49
+ [source]
50
50
  ----
51
51
  input {
52
52
  elastic_serverless_forwarder {
53
- <<plugins-{type}s-{plugin}-port,port>> => 8080
54
- <<plugins-{type}s-{plugin}-ssl,ssl>> => false
53
+ port => 8080
54
+ ssl => false
55
55
  }
56
56
  }
57
57
  ----
@@ -12,9 +12,6 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
12
12
 
13
13
  config_name "elastic_serverless_forwarder"
14
14
 
15
- # no-codec
16
- config :codec, obsolete: 'The elastic_serverless_forwarder input does not have an externally-configurable codec'
17
-
18
15
  # bind address
19
16
  config :host, :validate => :string, :default => "0.0.0.0"
20
17
  config :port, :validate => :number, :required => true
@@ -54,6 +51,11 @@ class LogStash::Inputs::ElasticServerlessForwarder < LogStash::Inputs::Base
54
51
 
55
52
  def initialize(*a)
56
53
  super
54
+
55
+ if original_params.include?('codec')
56
+ fail LogStash::ConfigurationError, 'The `elastic_serverless_forwarder` input does not have an externally-configurable `codec`'
57
+ end
58
+
57
59
  @internal_http = plugin_factory.input('http').new(inner_http_input_options)
58
60
  end
59
61
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'logstash-input-elastic_serverless_forwarder'
5
- s.version = '0.1.0'
5
+ s.version = '0.1.1'
6
6
  s.licenses = ['Apache License (2.0)']
7
7
  s.summary = "Receives events from Elastic Serverless Forwarder over HTTP or HTTPS"
8
8
  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"
@@ -41,6 +41,38 @@ describe LogStash::Inputs::ElasticServerlessForwarder do
41
41
  esf_input.stop
42
42
  end
43
43
 
44
+
45
+ end
46
+
47
+ context 'no user-defined codec' do
48
+ let(:config) { super().merge('ssl' => false) } # minimal config
49
+
50
+ ##
51
+ # @codec ivar is required PENDING https://github.com/elastic/logstash/issues/14828
52
+ context 'codec handling' do
53
+ it 'has an `@codec` ivar that inherits from `LogStash::Codecs::Base`' do
54
+ expect(esf_input).to be_instance_variable_defined(:@codec)
55
+ codec = esf_input.instance_variable_get(:@codec)
56
+
57
+ expect(codec).to_not be_nil
58
+ expect(codec.class).to be < LogStash::Codecs::Base # LogStash::Codecs::Delegator shenanigans
59
+ end
60
+ end
61
+
62
+ context 'when instantiated with a string codec' do
63
+ let(:config) { super().merge("codec" => "json_lines") }
64
+ it 'fails with a helpful configuration error' do
65
+ expect { described_class.new(config) }.to raise_exception(LogStash::ConfigurationError, a_string_including("codec"))
66
+ end
67
+ end
68
+
69
+ context 'when instantiated with a codec instance' do
70
+ let(:codec_instance) { Class.new(LogStash::Codecs::Base) { config_name 'test'}.new("id" => "123") }
71
+ let(:config) { super().merge("codec" => codec_instance) }
72
+ it 'fails with a helpful configuration error' do
73
+ expect { described_class.new(config) }.to raise_exception(LogStash::ConfigurationError, a_string_including("codec"))
74
+ end
75
+ end
44
76
  end
45
77
 
46
78
  shared_context "basic request handling" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-elastic_serverless_forwarder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-18 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement