sendsyslog-tcp

Sends input data as syslog messages to a remote server over TCP.

Command properties

PropertyDescription
Command typeTransforming
Required permissionNone
License usageN/A
Parallel executionNot supported
Distributed executionNot supported

Syntax

sendsyslog-tcp dst=IP [port=INT] [format={txt|json}] [pri=INT] [framing={lf|rfc6587}]

Options

dst=IP
IP address of the syslog receiving server.
port=INT
Port number of the syslog receiving server. (Default: 514)
format={txt|json}
Syslog message body format. (Default: txt)
  • txt: Sends the value of the line field of the input record as-is.
  • json: Converts the entire input record to JSON format and sends it. The _id, _table, and _time fields are excluded.
pri=INT

PRI value as defined in RFC 5424. The default of 134 corresponds to the local0 facility and info severity. (Default: 134)

The PRI value equals the facility value multiplied by 8, plus the severity value.

Facility / Severity0/Emer1/Alert2/Crit3/Error4/Warn5/Notice6/Info7/Debug
0 / kern01234567
1 / user89101112131415
2 / mail1617181920212223
3 / daemon2425262728293031
4 / auth3233343536373839
5 / syslog4041424344454647
6 / lpr4849505152535455
7 / news5657585960616263
8 / uucp6465666768697071
9 / clock7273747576777879
10 / authpriv8081828384858687
11 / ftp8889909192939495
12 / ntp96979899100101102103
13 / audit104105106107108109110111
14 / alert112113114115116117118119
15 / solaris-cron120121122123124125126127
16 / local0128129130131132133134 (default)135
17 / local1136137138139140141142143
18 / local2144145146147148149150151
19 / local3152153154155156157158159
20 / local4160161162163164165166167
21 / local5168169170171172173174175
22 / local6176177178179180181182183
23 / local7184185186187188189190191
framing={lf|rfc6587}

TCP syslog framing method. (Default: lf)

  • lf: Separates messages using a linefeed (LF) character.
  • rfc6587: Separates messages using octet counting as defined in RFC 6587.

Input fields

FieldTypeRequiredDescription
linestringRequired when format=txtText to send as the syslog message body. If null, an empty string is sent.

Error codes

Parsing errors
Error codeMessageDescription
24100Specify the dst option for the sendsyslog-tcp command.The dst option was not specified.
24101Specify the port option for the sendsyslog-tcp command.The port option was not specified.
24102Specify a valid host address for the dst option of the sendsyslog-tcp command.An invalid host address was specified for the dst option.
24103Specify a valid port value between 1 and 65535 for the port option of the sendsyslog-tcp command.A value outside the range 1–65535 was specified for the port option.
24104Specify a valid value for the pri option of the sendsyslog-tcp command.A non-integer value was specified for the pri option.
24105The framing option of the sendsyslog-tcp command must be lf or rfc6587.A value other than lf or rfc6587 was specified for the framing option.
24106The format option of the sendsyslog-tcp command must be txt or json.A value other than txt or json was specified for the format option.
Runtime errors

N/A

Description

The sendsyslog-tcp command generates a TCP syslog message for each input record and sends it to the specified remote server. Unlike the sendsyslog command, which uses UDP, this command uses TCP and therefore provides higher delivery reliability.

Syslog messages are formatted as <PRI>body. When format=txt, the value of the line field is used as the message body. When format=json, the entire input record is converted to JSON and used as the body, excluding the _id, _table, and _time fields. The body uses <PRI>{...} format, with no RFC 3164/RFC 5424 timestamp or hostname headers. The encoding is UTF-8. For example, with PRI 134, the body looks like:

<134>{"src_ip":"192.168.0.10","src_port":52344,"dst_ip":"10.0.0.5","dst_port":443,"protocol":"tcp","bytes":1480}

Each field is converted to a JSON value according to the following rules.

Logpresso typeJSON representation
stringJSON string
integer, float (int, long, double, etc.)JSON number
booleantrue / false
nullnull
dateString in "yyyy-MM-dd HH:mm:ssZ" format (e.g., "2026-05-04 13:45:00+0900")
IP addressAddress string (e.g., "192.168.0.10")
UUIDUUID string
binaryLowercase hexadecimal string
arrayJSON array (each element recursively converted by the rules above)
mapJSON object (values recursively converted by the rules above)

The order of keys in the JSON object is not guaranteed. Write your receiver parser to operate based on key names. If the receiver needs time information, use the eval command to copy _time to a separate field before passing it to sendsyslog-tcp.

The framing option specifies how messages are delimited in the TCP stream. lf uses a linefeed character, and rfc6587 prefixes each message with its length.

Regardless of whether transmission succeeds, the input record is passed to the next command unchanged. If a transmission error occurs, only the first error is logged; subsequent identical errors are suppressed.

If the TCP connection drops or delays occur, the message queue may back up. Messages that cannot be transmitted within 30 seconds are discarded. The following JVM options control queue management behavior.

JVM OptionDescriptionValue
-Dlogpresso.tcp_sender.idle_timeoutThreshold for stopping transmission when there is no response from the server1–86400 seconds (default: 300)
-Dlogpresso.tcp_sender.max_queue_timeThreshold for stopping transmission when delivery takes too long1–600 seconds (default: 30)
-Dlogpresso.tcp_sender.max_queue_charsThreshold for stopping transmission when too many characters are queued1,000,000–1,000,000,000 characters (default: 100,000,000)

Examples

  1. Send TCP syslog messages in text format

    table duration=1h web_logs
    | sendsyslog-tcp dst=198.51.100.10
    

    Sends the line field of the web logs from the past hour as TCP syslog messages to 198.51.100.10:514.

  2. Send TCP syslog messages in JSON format

    table duration=1h web_logs
    | sendsyslog-tcp dst=198.51.100.10 port=1514 format=json
    

    Converts all fields of the web logs to JSON format and sends them to 198.51.100.10:1514 over TCP.

  3. Use RFC 6587 framing

    table duration=1h web_logs
    | sendsyslog-tcp dst=198.51.100.10 port=1514 format=json framing=rfc6587
    

    Sends JSON-formatted syslog messages over TCP using RFC 6587 octet-counting framing.

  4. Specify a PRI value

    table duration=1h security_logs
    | sendsyslog-tcp dst=198.51.100.10 pri=165
    

    Sets the PRI value to 165 (local4 + notice) and sends the security logs as TCP syslog messages.