Logstash to SigNoz

If you use Logstash to collect logs in your stack, this tutorial will help you send logs from Logstash to SigNoz.

At SigNoz, we use the OpenTelemetry collector to receive logs, which supports the TCP protocol. You can forward your logs from your Logstash agent to the OpenTelemetry collector.

Collect Logs Using Logstash in SigNoz Cloud

  1. Add OpenTelemetry Collector Binary: Add the OpenTelemetry collector binary to your VM by following this guide.

  2. Configure the Receiver: Add the receiver to your config.yaml:

    receivers:
      tcplog/logstash:
        max_log_size: 1MiB
        listen_address: "0.0.0.0:2255"
        attributes: {}
        resource: {}
        add_attributes: false
        operators: []
    
    • Port 2255 is used here for listening via the TCP protocol, but you can use a port of your choice.
    • Learn more about the tcplog receiver here.
  3. Modify the config.yaml: Update your service configuration to include the receiver:

    service:
        ...
        logs:
            receivers: [otlp, tcplog/logstash]
            processors: [batch]
            exporters: [otlp]
    
  4. Update Logstash Configuration: Change the Logstash config to forward logs to the OpenTelemetry collector:

    output {
      tcp {
        codec => json_lines # Ensures logs are sent in JSON format line-by-line
        host => "localhost"
        port => 2255
      }
    }
    
    • This config assumes the Logstash binary is running on the same host. Adjust the host value if Logstash is running elsewhere.
  5. Start the Services: Once the changes are made, start the OpenTelemetry binary and Logstash. You should see the logs in SigNoz.

  6. Transform Logs: Use OpenTelemetry processors to transform your log model into the OpenTelemetry log data model. Learn more about available processors here.

Was this page helpful?