LinkMesh

Search docs, blog and changelog

ENDE

Snippets · Sources

Receive plain log lines over TCP

Appliances, legacy applications and shell scripts often can only write lines to a TCP socket. The tcplog receiver accepts them, one log record per line, with a size limit per line.

Signals
Logs
Category
Collection
Source
TCP (newline-delimited)
Components
batchmemory_limiterotlphttp
Destination
OTLP/HTTP endpoint

OpenTelemetry Collector

OpenTelemetry Collector YAML
receivers:
  tcplog:
    listen_address: 0.0.0.0:5140
    max_log_size: 1MiB

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  batch:
    timeout: 5s

exporters:
  otlphttp:
    endpoint: https://your-backend:4318

service:
  pipelines:
    logs:
      receivers: [tcplog]
      processors: [memory_limiter, batch]
      exporters: [otlphttp]

LinkMesh

Library › Sources › TCP Log

Listen Address
0.0.0.0:5140
Max Log Size
1MiB

What LinkMesh then pushes to the collector, under receivers:

Pushed to the collector
tcplog/input_src_00000501:
  listen_address: 0.0.0.0:5140
  max_log_size: 1MiB

The same, as an API call (see automation recipes):

API call
curl -X POST "$LINKMESH/sources" \
  -H "Authorization: Bearer $LMSAT" \
  -H "Content-Type: application/json" \
  -d '{
  "defaultConfig": {
    "listen_address": "0.0.0.0:5140",
    "max_log_size": "1MiB"
  },
  "name": "TCP Log",
  "receiverType": "tcplog"
}'

The rest of the collector config above (memory_limiter, batch, otlphttp) is not part of this template: in LinkMesh those are separate sources, processors and destinations on the route.

Generated from LinkMesh's template catalogue by linkmesh-server snippet-render 1.464.3, not written by hand.

Download config.yamlValidated with otelcol-contrib v0.161.0 on 2026-10-26

Complete config files, each checked with the collector's own validate command (otelcol-contrib v0.161.0). Replace https://your-backend:4318 with your own OTLP endpoint before you run it.

The gotcha

A line counts as complete only when its newline arrives. In our test a sender that kept its connection open had its last, unterminated line held back - only the newline-terminated line arrived - and that line was emitted only when the connection closed. Make senders terminate every message with a newline.

Manage this across a fleet

LinkMesh manages collector configuration across a fleet from one self-hosted control plane, so a change like this is made once rather than host by host. The first 25 Collectors are free after a no-card registration in the OpenSight Customer Portal (5 without one).

Doing this in LinkMesh: Sources