logstash-input-tcp 4.1.0 → 4.1.2
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 +3 -0
- data/Gemfile +8 -1
- data/docs/index.asciidoc +205 -0
- data/lib/logstash/inputs/tcp.rb +42 -0
- data/logstash-input-tcp.gemspec +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08f07f06c65b618f52c45c54f344183beca7f64f
|
4
|
+
data.tar.gz: df32793b0047844212f1fad6cc1a45dd5cf0dbee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 035e413e1bcd0093ac595e4cb92cd8ed7733b5bde73e2114559968f1d103814368a25418969907f9e881f00c737034b4fbed8e7c41ddb9234a1c798e26f36904
|
7
|
+
data.tar.gz: 94039950c7de7183b110e84015177b774e0cc91afcca052623ae2e3e2d38694987ec9717256e94fcce519ad95f430a34e31c7e1b67a3e478d09cca6acf022943
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in logstash-mass_effect.gemspec
|
4
3
|
gemspec
|
4
|
+
|
5
|
+
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
|
6
|
+
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
|
7
|
+
|
8
|
+
if Dir.exist?(logstash_path) && use_logstash_source
|
9
|
+
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
|
10
|
+
gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
|
11
|
+
end
|
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
:plugin: tcp
|
2
|
+
:type: input
|
3
|
+
|
4
|
+
///////////////////////////////////////////
|
5
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
6
|
+
///////////////////////////////////////////
|
7
|
+
:version: %VERSION%
|
8
|
+
:release_date: %RELEASE_DATE%
|
9
|
+
:changelog_url: %CHANGELOG_URL%
|
10
|
+
:include_path: ../../../../logstash/docs/include
|
11
|
+
///////////////////////////////////////////
|
12
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
13
|
+
///////////////////////////////////////////
|
14
|
+
|
15
|
+
[id="plugins-{type}-{plugin}"]
|
16
|
+
|
17
|
+
=== Tcp input plugin
|
18
|
+
|
19
|
+
include::{include_path}/plugin_header.asciidoc[]
|
20
|
+
|
21
|
+
==== Description
|
22
|
+
|
23
|
+
Read events over a TCP socket.
|
24
|
+
|
25
|
+
Like stdin and file inputs, each event is assumed to be one line of text.
|
26
|
+
|
27
|
+
Can either accept connections from clients or connect to a server,
|
28
|
+
depending on `mode`.
|
29
|
+
|
30
|
+
#### Accepting log4j2 logs
|
31
|
+
|
32
|
+
Log4j2 can send JSON over a socket, and we can use that combined with our tcp
|
33
|
+
input to accept the logs.
|
34
|
+
|
35
|
+
First, we need to configure your application to send logs in JSON over a
|
36
|
+
socket. The following log4j2.xml accomplishes this task.
|
37
|
+
|
38
|
+
Note, you will want to change the `host` and `port` settings in this
|
39
|
+
configuration to match your needs.
|
40
|
+
|
41
|
+
<Configuration>
|
42
|
+
<Appenders>
|
43
|
+
<Socket name="Socket" host="localhost" port="12345">
|
44
|
+
<JsonLayout compact="true" eventEol="true" />
|
45
|
+
</Socket>
|
46
|
+
</Appenders>
|
47
|
+
<Loggers>
|
48
|
+
<Root level="info">
|
49
|
+
<AppenderRef ref="Socket"/>
|
50
|
+
</Root>
|
51
|
+
</Loggers>
|
52
|
+
</Configuration>
|
53
|
+
|
54
|
+
To accept this in Logstash, you will want tcp input and a date filter:
|
55
|
+
|
56
|
+
input {
|
57
|
+
tcp {
|
58
|
+
port => 12345
|
59
|
+
codec => json
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
and add a date filter to take log4j2's `timeMillis` field and use it as the
|
64
|
+
event timestamp
|
65
|
+
|
66
|
+
filter {
|
67
|
+
date {
|
68
|
+
match => [ "timeMillis", "UNIX_MS" ]
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
[id="plugins-{type}s-{plugin}-options"]
|
73
|
+
==== Tcp Input Configuration Options
|
74
|
+
|
75
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
76
|
+
|
77
|
+
[cols="<,<,<",options="header",]
|
78
|
+
|=======================================================================
|
79
|
+
|Setting |Input type|Required
|
80
|
+
| <<plugins-{type}s-{plugin}-host>> |<<string,string>>|No
|
81
|
+
| <<plugins-{type}s-{plugin}-mode>> |<<string,string>>, one of `["server", "client"]`|No
|
82
|
+
| <<plugins-{type}s-{plugin}-port>> |<<number,number>>|Yes
|
83
|
+
| <<plugins-{type}s-{plugin}-proxy_protocol>> |<<boolean,boolean>>|No
|
84
|
+
| <<plugins-{type}s-{plugin}-ssl_cert>> |a valid filesystem path|No
|
85
|
+
| <<plugins-{type}s-{plugin}-ssl_enable>> |<<boolean,boolean>>|No
|
86
|
+
| <<plugins-{type}s-{plugin}-ssl_extra_chain_certs>> |<<array,array>>|No
|
87
|
+
| <<plugins-{type}s-{plugin}-ssl_key>> |a valid filesystem path|No
|
88
|
+
| <<plugins-{type}s-{plugin}-ssl_key_passphrase>> |<<password,password>>|No
|
89
|
+
| <<plugins-{type}s-{plugin}-ssl_verify>> |<<boolean,boolean>>|No
|
90
|
+
|=======================================================================
|
91
|
+
|
92
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
93
|
+
input plugins.
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
[id="plugins-{type}s-{plugin}-data_timeout"]
|
98
|
+
===== `data_timeout` (DEPRECATED)
|
99
|
+
|
100
|
+
* DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
|
101
|
+
* Value type is <<number,number>>
|
102
|
+
* Default value is `-1`
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
[id="plugins-{type}s-{plugin}-host"]
|
107
|
+
===== `host`
|
108
|
+
|
109
|
+
* Value type is <<string,string>>
|
110
|
+
* Default value is `"0.0.0.0"`
|
111
|
+
|
112
|
+
When mode is `server`, the address to listen on.
|
113
|
+
When mode is `client`, the address to connect to.
|
114
|
+
|
115
|
+
[id="plugins-{type}s-{plugin}-mode"]
|
116
|
+
===== `mode`
|
117
|
+
|
118
|
+
* Value can be any of: `server`, `client`
|
119
|
+
* Default value is `"server"`
|
120
|
+
|
121
|
+
Mode to operate in. `server` listens for client connections,
|
122
|
+
`client` connects to a server.
|
123
|
+
|
124
|
+
[id="plugins-{type}s-{plugin}-port"]
|
125
|
+
===== `port`
|
126
|
+
|
127
|
+
* This is a required setting.
|
128
|
+
* Value type is <<number,number>>
|
129
|
+
* There is no default value for this setting.
|
130
|
+
|
131
|
+
When mode is `server`, the port to listen on.
|
132
|
+
When mode is `client`, the port to connect to.
|
133
|
+
|
134
|
+
[id="plugins-{type}s-{plugin}-proxy_protocol"]
|
135
|
+
===== `proxy_protocol`
|
136
|
+
|
137
|
+
* Value type is <<boolean,boolean>>
|
138
|
+
* Default value is `false`
|
139
|
+
|
140
|
+
Proxy protocol support, only v1 is supported at this time
|
141
|
+
http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
|
142
|
+
|
143
|
+
[id="plugins-{type}s-{plugin}-ssl_cacert"]
|
144
|
+
===== `ssl_cacert` (DEPRECATED)
|
145
|
+
|
146
|
+
* DEPRECATED WARNING: This configuration item is deprecated and may not be available in future versions.
|
147
|
+
* Value type is <<path,path>>
|
148
|
+
* There is no default value for this setting.
|
149
|
+
|
150
|
+
The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.
|
151
|
+
|
152
|
+
[id="plugins-{type}s-{plugin}-ssl_cert"]
|
153
|
+
===== `ssl_cert`
|
154
|
+
|
155
|
+
* Value type is <<path,path>>
|
156
|
+
* There is no default value for this setting.
|
157
|
+
|
158
|
+
SSL certificate path
|
159
|
+
|
160
|
+
[id="plugins-{type}s-{plugin}-ssl_enable"]
|
161
|
+
===== `ssl_enable`
|
162
|
+
|
163
|
+
* Value type is <<boolean,boolean>>
|
164
|
+
* Default value is `false`
|
165
|
+
|
166
|
+
Enable SSL (must be set for other `ssl_` options to take effect).
|
167
|
+
|
168
|
+
[id="plugins-{type}s-{plugin}-ssl_extra_chain_certs"]
|
169
|
+
===== `ssl_extra_chain_certs`
|
170
|
+
|
171
|
+
* Value type is <<array,array>>
|
172
|
+
* Default value is `[]`
|
173
|
+
|
174
|
+
An Array of extra X509 certificates to be added to the certificate chain.
|
175
|
+
Useful when the CA chain is not necessary in the system store.
|
176
|
+
|
177
|
+
[id="plugins-{type}s-{plugin}-ssl_key"]
|
178
|
+
===== `ssl_key`
|
179
|
+
|
180
|
+
* Value type is <<path,path>>
|
181
|
+
* There is no default value for this setting.
|
182
|
+
|
183
|
+
SSL key path
|
184
|
+
|
185
|
+
[id="plugins-{type}s-{plugin}-ssl_key_passphrase"]
|
186
|
+
===== `ssl_key_passphrase`
|
187
|
+
|
188
|
+
* Value type is <<password,password>>
|
189
|
+
* Default value is `nil`
|
190
|
+
|
191
|
+
SSL key passphrase
|
192
|
+
|
193
|
+
[id="plugins-{type}s-{plugin}-ssl_verify"]
|
194
|
+
===== `ssl_verify`
|
195
|
+
|
196
|
+
* Value type is <<boolean,boolean>>
|
197
|
+
* Default value is `true`
|
198
|
+
|
199
|
+
Verify the identity of the other end of the SSL connection against the CA.
|
200
|
+
For input, sets the field `sslsubject` to that of the client certificate.
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
205
|
+
include::{include_path}/{type}.asciidoc[]
|
data/lib/logstash/inputs/tcp.rb
CHANGED
@@ -11,6 +11,48 @@ require "openssl"
|
|
11
11
|
#
|
12
12
|
# Can either accept connections from clients or connect to a server,
|
13
13
|
# depending on `mode`.
|
14
|
+
#
|
15
|
+
# #### Accepting log4j2 logs
|
16
|
+
#
|
17
|
+
# Log4j2 can send JSON over a socket, and we can use that combined with our tcp
|
18
|
+
# input to accept the logs.
|
19
|
+
#
|
20
|
+
# First, we need to configure your application to send logs in JSON over a
|
21
|
+
# socket. The following log4j2.xml accomplishes this task.
|
22
|
+
#
|
23
|
+
# Note, you will want to change the `host` and `port` settings in this
|
24
|
+
# configuration to match your needs.
|
25
|
+
#
|
26
|
+
# <Configuration>
|
27
|
+
# <Appenders>
|
28
|
+
# <Socket name="Socket" host="localhost" port="12345">
|
29
|
+
# <JsonLayout compact="true" eventEol="true" />
|
30
|
+
# </Socket>
|
31
|
+
# </Appenders>
|
32
|
+
# <Loggers>
|
33
|
+
# <Root level="info">
|
34
|
+
# <AppenderRef ref="Socket"/>
|
35
|
+
# </Root>
|
36
|
+
# </Loggers>
|
37
|
+
# </Configuration>
|
38
|
+
#
|
39
|
+
# To accept this in Logstash, you will want tcp input and a date filter:
|
40
|
+
#
|
41
|
+
# input {
|
42
|
+
# tcp {
|
43
|
+
# port => 12345
|
44
|
+
# codec => json
|
45
|
+
# }
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# and add a date filter to take log4j2's `timeMillis` field and use it as the
|
49
|
+
# event timestamp
|
50
|
+
#
|
51
|
+
# filter {
|
52
|
+
# date {
|
53
|
+
# match => [ "timeMillis", "UNIX_MS" ]
|
54
|
+
# }
|
55
|
+
# }
|
14
56
|
class LogStash::Inputs::Tcp < LogStash::Inputs::Base
|
15
57
|
config_name "tcp"
|
16
58
|
|
data/logstash-input-tcp.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-tcp'
|
3
|
-
s.version = '4.1.
|
3
|
+
s.version = '4.1.2'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "Read events over a TCP socket."
|
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"
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.require_paths = ["lib"]
|
11
11
|
|
12
12
|
# Files
|
13
|
-
s.files = Dir[
|
13
|
+
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
|
14
14
|
|
15
15
|
# Tests
|
16
16
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-tcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- LICENSE
|
141
141
|
- NOTICE.TXT
|
142
142
|
- README.md
|
143
|
+
- docs/index.asciidoc
|
143
144
|
- lib/logstash/inputs/tcp.rb
|
144
145
|
- logstash-input-tcp.gemspec
|
145
146
|
- spec/inputs/tcp_spec.rb
|