SigNoz Cloud - This page is relevant for SigNoz Cloud editions.
Self-Host - This page is relevant for self-hosted SigNoz editions.

Send logs from Logstash to SigNoz via OpenTelemetry

If you use Logstash to collect logs in your stack, you can forward them to SigNoz via the OpenTelemetry Collector using the TCP protocol.

Prerequisites

Send Logs to SigNoz

Step 1: Add OpenTelemetry Collector Binary

Add the OpenTelemetry Collector binary to your VM by following the OTel binary setup guide.

Step 2: Configure the tcplog Receiver

Merge the following into your existing config.yaml. If your config already has a processors: block, add the new entries under it rather than replacing it. For more on receivers, see the OTel Collector configuration guide.

config.yaml
receivers:
  tcplog/logstash:
    # max_log_size: 1MiB  # default; increase if your logs exceed this size
    listen_address: '0.0.0.0:2256'
    operators:
      # Parse the JSON that Logstash sends via codec => json_lines
      # Non-JSON logs pass through unparsed (on_error: send_quiet)
      - type: json_parser
        timestamp:
          parse_from: attributes["@timestamp"]
          layout_type: gotime
          layout: '2006-01-02T15:04:05.999Z07:00'
        on_error: send_quiet
      # Move Logstash's `message` field to the OTel log body
      - type: move
        from: attributes.message
        to: body

processors:
  batch:
  resourcedetection:
    detectors: [system, env]
    timeout: 5s
  transform:
    log_statements:
      - context: log
        statements:
          # Promote service.name to a resource attribute for consistent querying
          - set(resource.attributes["service.name"], log.attributes["service.name"]) where log.attributes["service.name"] != nil
          - delete_key(log.attributes, "service.name") where log.attributes["service.name"] != nil

exporters:
  otlp:
    endpoint: "https://ingest.<region>.signoz.cloud:443"
    headers:
      signoz-ingestion-key: "<your-ingestion-key>"

service:
  pipelines:
    logs:
      receivers: [tcplog/logstash]
      processors: [resourcedetection, transform, batch]
      exporters: [otlp]

Verify these values:

📝 Note
  • Port 2256 is used here, but you can use any available port.
  • on_error: send_quiet lets non-JSON logs pass through unparsed rather than dropping them — useful when Logstash emits plain-text startup messages alongside JSON logs.
  • The system detector populates host.name (OS hostname, DNS-resolved first) and os.type. If a configured detector is unavailable, the collector will refuse to start. Full detector options: Resource Attributes for Logs.
  • For more configuration options for the tcplog receiver, see tcplog receiver docs.

Step 3: Update Logstash Configuration

Add the following output block to your Logstash configuration:

logstash.conf
output {
  tcp {
    codec => json_lines # Ensures logs are sent in JSON format line-by-line
    host => "localhost"
    port => 2256
  }
}
  • This config assumes Logstash is running on the same host as the Collector. Set the host value if Logstash is running elsewhere.

Step 4: Start the Services

Restart the OpenTelemetry Collector and Logstash:

sudo systemctl restart otelcol-contrib
sudo systemctl restart logstash

Change the service name if you installed the Collector under a different name (e.g., otelcol).

Validate

Once the services are running:

  1. Open SigNoz and navigate to Logs > Logs Explorer.
  2. Filter by resource.host.name to confirm logs are arriving. The system detector populates this attribute on every log. If your Logstash pipeline sets a service.name field on events, filter by service.name = '<service_name>' to narrow by service.
  3. Click on a log entry and verify it contains:
    • body: the message value from the Logstash event
    • attributes: remaining Logstash JSON fields (varies by your Logstash pipeline config)
    • resource.host.name: the OTel Collector's OS hostname
    • resource.service.name: promoted from the Logstash event if your pipeline sets it
Sample logs in Logs Explorer
Sample logs in Logs Explorer

Transform Logs (Optional)

The config above parses Logstash's JSON output into structured attributes and populates host.name via resource detection. To enrich logs further, see SigNoz Log Pipelines.

Troubleshooting

Logs are not appearing in SigNoz

  • Verify that the OpenTelemetry Collector is running and the tcplog/logstash receiver is enabled in both the receivers section and the service.pipelines.logs pipeline.
  • Confirm that Logstash is sending logs to the correct host and port (e.g., localhost:2256).
  • Check the OpenTelemetry Collector logs for errors related to the tcplog receiver.
  • After fixing, restart both services and check Logs > Logs Explorer in SigNoz to confirm logs appear.

Port conflict

  • If port 2256 is already in use, choose a different port. Update the port in both the Collector config.yaml and the Logstash output configuration.
  • After updating, restart both services and verify logs appear in Logs > Logs Explorer.

Logs appear but are not parsed correctly

  • Ensure the Logstash output block uses codec => json_lines so logs are sent as newline-delimited JSON.
  • If logs arrive with raw JSON in body and empty attributes, the json_parser operator may be failing silently. Check the Collector logs, the on_error: send_quiet option suppresses parse errors so non-JSON logs pass through unparsed.
  • Use Log Pipelines in SigNoz to parse and transform log fields further.

Next Steps

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack.

If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Last updated: April 1, 2026

Edit on GitHub

Was this page helpful?

Your response helps us improve this page.