-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
142 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
[[ls-to-ls-native]] | ||
=== Logstash-to-Logstash: Output to Input | ||
|
||
The Logstash output to Logstash input is the default approach for Logstash-to-Logstash communication. | ||
|
||
NOTE: Check out these <<native-considerations,considerations>> before you implement {ls}-to-{ls}. | ||
|
||
[[overview-ls-ls]] | ||
==== Configuration overview | ||
|
||
To connect two Logstash instances: | ||
|
||
. Configure the downstream (server) Logstash to use Logstash input | ||
. Configure the upstream (client) Logstash to use Logstash output | ||
. Secure the communication between Logstash input and Logstash output | ||
|
||
[[configure-downstream-logstash-input]] | ||
===== Configure the downstream Logstash to use Logstash input | ||
|
||
Configure the Logstash input on the downstream (receiving) Logstash to receive connections. | ||
The minimum configuration requires this option: | ||
|
||
* `port` - To set a custom port. | ||
|
||
[source,json] | ||
---- | ||
input { | ||
logstash { | ||
port => 8080 | ||
} | ||
} | ||
---- | ||
|
||
[[configure-upstream-logstash-output]] | ||
===== Configure the upstream Logstash to use Logstash output | ||
|
||
In order to obtain the best performance when sending data from one Logstash to another, the data needs to be batched and compressed. As such, the upstream Logstash (the sending Logstash) needs to be configured with these options: | ||
|
||
* `host` - The receiving Logstash. | ||
* `port` - The receiving Logstash port. | ||
|
||
[source,json] | ||
---- | ||
output { | ||
logstash { | ||
host => '10.0.0.123' | ||
port => '8080' | ||
} | ||
} | ||
---- | ||
|
||
[[securing-logstash-to-logstash]] | ||
===== Secure Logstash to Logstash | ||
|
||
It is important that you secure the communication between Logstash instances. | ||
Use SSL/TLS mutual authentication in order to ensure that the upstream Logstash instance sends encrypted data to a trusted downstream Logstash instance, and vice versa. | ||
|
||
. Create a certificate authority (CA) in order to sign the certificates that you plan to use between Logstash instances. Creating a correct SSL/TLS infrastructure is outside the scope of this document. | ||
+ | ||
TIP: We recommend you use the {ref}/certutil.html[elasticsearch-certutil] tool to generate your certificates. | ||
|
||
. Configure the downstream (receiving) Logstash to use SSL. | ||
Add these settings to the HTTP Input configuration: | ||
+ | ||
* `ssl_enabled`: When set to `true`, it enables Logstash use of SSL/TLS | ||
* `ssl_key`: Specifies the key that Logstash uses to authenticate with the client. | ||
* `ssl_certificate`: Specifies the certificate that Logstash uses to authenticate with the client. | ||
* `ssl_certificate_authorities`: Configures Logstash to trust any certificates signed by the specified CA. | ||
* `ssl_verification_mode`: Specifies whether Logstash server verifies the client certificate against the CA. | ||
+ | ||
For example: | ||
+ | ||
[source,json] | ||
---- | ||
input { | ||
logstash { | ||
... | ||
ssl_enabled => true | ||
ssl_key => "server.key.pk8" | ||
ssl_certificate => "server.crt" | ||
ssl_certificate_authorities => "ca.crt" | ||
ssl_verification_mode => force_peer | ||
} | ||
} | ||
---- | ||
|
||
. Configure the upstream (sending) Logstash to use SSL. | ||
Add these settings to the Logstash output configuration: | ||
+ | ||
* `ssl_key`: Specifies the key the Logstash client uses to authenticate with the Logstash server. | ||
* `ssl_certificate`: Specifies the certificate that the Logstash client uses to authenticate to the Logstash server. | ||
* `ssl_certificate_authorities`: Configures the Logstash client to trust any certificates signed by the specified CA. | ||
+ | ||
For example: | ||
+ | ||
[source,json] | ||
---- | ||
output { | ||
logstash { | ||
... | ||
ssl_enabled => true | ||
ssl_key => "client.key.pk8" | ||
ssl_certificate => "client.crt" | ||
ssl_certificate_authorities => "ca.crt" | ||
} | ||
} | ||
---- | ||
|
||
. If you would like an additional authentication step, you can also use basic user/password authentication in both Logstash instances: | ||
+ | ||
* `username`: Sets the username to use for authentication. | ||
* `password`: Sets the password to use for authentication. | ||
+ | ||
For example, you would need to add the following to both Logstash instances: | ||
+ | ||
[source,json] | ||
---- | ||
... | ||
logstash { | ||
... | ||
username => "your-user" | ||
password => "your-secret" | ||
} | ||
... | ||
---- |