﻿---
title: Tcp output plugin v5.0.2
description: Plugin version: v5.0.2, Released on: 2017-11-13, Changelog. For other versions, see the overview list. To learn more about Logstash, see the Logstash...
url: https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/vpr/v5-0-2-plugins-outputs-tcp
---

# Tcp output plugin v5.0.2
- Plugin version: v5.0.2
- Released on: 2017-11-13
- [Changelog](https://github.com/logstash-plugins/logstash-output-tcp/blob/v5.0.2/CHANGELOG.md)

For other versions, see the [overview list](https://docs-v3-preview.elastic.dev/elastic/logstash-docs-md/tree/main/vpr/output-tcp-index).
To learn more about Logstash, see the [Logstash Reference](https://www.elastic.co/guide/en/logstash/current/index.html).

## Getting help

For questions about the plugin, open a topic in the [Discuss](http://discuss.elastic.co) forums. For bugs or feature requests, open an issue in [Github](https://github.com/logstash-plugins/logstash-output-tcp). For the list of Elastic supported plugins, please consult the [Elastic Support Matrix](https://www.elastic.co/support/matrix#matrix_logstash_plugins).

## Description

Write events over a TCP socket.
Each event json is separated by a newline.
Can either accept connections from clients or connect to a server, depending on `mode`.

## Tcp Output Configuration Options

This plugin supports the following configuration options plus the [Common options](#v5.0.2-plugins-outputs-tcp-common-options) described later.

| Setting                                                                                    | Input type                                                                                                | Required |
|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|----------|
| [`host`](#v5.0.2-plugins-outputs-tcp-host)`host`                                           | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string                                | Yes      |
| [`mode`](#v5.0.2-plugins-outputs-tcp-mode)`mode`                                           | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string, one of `["server", "client"]` | No       |
| [`port`](#v5.0.2-plugins-outputs-tcp-port)`port`                                           | [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)number                                | Yes      |
| [`reconnect_interval`](#v5.0.2-plugins-outputs-tcp-reconnect_interval)`reconnect_interval` | [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)number                                | No       |
| [`ssl_cacert`](#v5.0.2-plugins-outputs-tcp-ssl_cacert)`ssl_cacert`                         | a valid filesystem path                                                                                   | No       |
| [`ssl_cert`](#v5.0.2-plugins-outputs-tcp-ssl_cert)`ssl_cert`                               | a valid filesystem path                                                                                   | No       |
| [`ssl_enable`](#v5.0.2-plugins-outputs-tcp-ssl_enable)`ssl_enable`                         | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean                             | No       |
| [`ssl_key`](#v5.0.2-plugins-outputs-tcp-ssl_key)`ssl_key`                                  | a valid filesystem path                                                                                   | No       |
| [`ssl_key_passphrase`](#v5.0.2-plugins-outputs-tcp-ssl_key_passphrase)`ssl_key_passphrase` | [password](/elastic/logstash-docs-md/tree/main/lsr/value-types#password)password                          | No       |
| [`ssl_verify`](#v5.0.2-plugins-outputs-tcp-ssl_verify)`ssl_verify`                         | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean                             | No       |

Also see [Common options](#v5.0.2-plugins-outputs-tcp-common-options) for a list of options supported by all output plugins.

### `host`

- This is a required setting.
- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

When mode is `server`, the address to listen on. When mode is `client`, the address to connect to.

### `mode`

- Value can be any of: `server`, `client`
- Default value is `"client"`

Mode to operate in. `server` listens for client connections, `client` connects to a server.

### `port`

- This is a required setting.
- Value type is [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)
- There is no default value for this setting.

When mode is `server`, the port to listen on. When mode is `client`, the port to connect to.

### `reconnect_interval`

- Value type is [number](/elastic/logstash-docs-md/tree/main/lsr/value-types#number)
- Default value is `10`

When connect failed,retry interval in sec.

### `ssl_cacert`

- Value type is [path](/elastic/logstash-docs-md/tree/main/lsr/value-types#path)
- There is no default value for this setting.

The SSL CA certificate, chainfile or CA path. The system CA path is automatically included.

### `ssl_cert`

- Value type is [path](/elastic/logstash-docs-md/tree/main/lsr/value-types#path)
- There is no default value for this setting.

SSL certificate path

### `ssl_enable`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `false`

Enable SSL (must be set for other `ssl_` options to take effect).

### `ssl_key`

- Value type is [path](/elastic/logstash-docs-md/tree/main/lsr/value-types#path)
- There is no default value for this setting.

SSL key path

### `ssl_key_passphrase`

- Value type is [password](/elastic/logstash-docs-md/tree/main/lsr/value-types#password)
- Default value is `nil`

SSL key passphrase

### `ssl_verify`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `false`

Verify the identity of the other end of the SSL connection against the CA. For input, sets the field `sslsubject` to that of the client certificate.

## Common options

These configuration options are supported by all output plugins:

| Setting                                                                     | Input type                                                                    | Required |
|-----------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------|
| [`codec`](#v5.0.2-plugins-outputs-tcp-codec)`codec`                         | [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)codec       | No       |
| [`enable_metric`](#v5.0.2-plugins-outputs-tcp-enable_metric)`enable_metric` | [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)boolean | No       |
| [`id`](#v5.0.2-plugins-outputs-tcp-id)`id`                                  | [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)string    | No       |


### `codec`

- Value type is [codec](/elastic/logstash-docs-md/tree/main/lsr/value-types#codec)
- Default value is `"plain"`

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output without needing a separate filter in your Logstash pipeline.

### `enable_metric`

- Value type is [boolean](/elastic/logstash-docs-md/tree/main/lsr/value-types#boolean)
- Default value is `true`

Disable or enable metric logging for this specific plugin instance. By default we record all the metrics we can, but you can disable metrics collection for a specific plugin.

### `id`

- Value type is [string](/elastic/logstash-docs-md/tree/main/lsr/value-types#string)
- There is no default value for this setting.

Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one. It is strongly recommended to set this ID in your configuration. This is particularly useful when you have two or more plugins of the same type. For example, if you have 2 tcp outputs. Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
```
output {
  tcp {
    id => "my_plugin_id"
  }
}
```