Skip to main content
Collect EC2 syslog files with an OpenTelemetry collector and send them to ClickHouse Observability with instance metadata. Use the demo dataset to try the integration without an EC2 instance.

Prerequisites

  • A ClickHouse Observability service
  • For your own logs, a Linux EC2 instance with syslog files, access to its instance metadata service, and permission to install and run the collector
  • For the demo, Docker
  • curl to download the collector or sample

Connection details

Open ClickHouse Observability and go to Team Settings → Data → Managed Telemetry. Copy your OTLP HTTP endpoint and API key. You can use Copy connection details to copy the configuration, or Reveal key to view the masked key.For the OTLP exporter examples below, set these variables in the terminal where you will run the collector:
Replace the placeholders with the exact endpoint, including its port, and API key from your service. Use the base HTTP endpoint without a /v1/logs suffix; the exporter appends the signal path.
Your EC2 instance must be able to reach the endpoint. For the Docker demo, a destination collector on your own computer is reachable at http://host.docker.internal:4318; the demo command includes the host mapping.

Integration with an existing EC2 instance

Run these steps on the EC2 instance whose logs you want to collect.
1

Verify instance metadata and syslog

Check that the instance metadata service is accessible using IMDSv2:
The response should contain your instance ID. The collector uses this metadata service to add instance ID, type, region, availability zone, and account ID to your logs. The configuration below does not collect EC2 tags.Locate your syslog file and inspect its format:
Use the path that exists on your instance. If it writes only to the systemd journal, use the Systemd/Journald guide for collection.
2

Install the collector

Download OpenTelemetry Collector Contrib 0.161.0 for your instance’s architecture:
3

Configure the collector

Save the matching configuration as ec2-host-logs.yaml. Choose by the timestamp format in your file and adjust include if your syslog path differs.
For timestamps such as 2026-10-15T12:34:56.123456+00:00:
The receiver retains the original log line and extracts hostname, unit, PID (when present), and message. The resourcedetection/ec2 processor adds EC2 resource attributes. To collect instance tags as well, see the EC2 detector configuration and its permission requirements.
4

Run the collector

Set the connection variables in this terminal, then run from the directory containing the configuration. The collector needs permission to read the syslog file:
Keep the terminal open. The receiver uses start_at: end, so generate new activity that writes to the syslog file after startup. For ongoing collection, configure a service using your deployment process and supply the connection variables to that service.
5

Verify logs

Open Search, select your Logs source, filter for ServiceName:ec2-host-service, and select Last 15 minutes. Expand a record and check cloud.provider, cloud.region, cloud.availability_zone, host.id, and host.type in its resource attributes.

Demo dataset

The sample contains 11,658 syslog lines covering 24 hours. The collector adds simulated EC2 metadata and refreshes the timestamps; no AWS account is needed.
1

Download the sample

2

Configure the demo collector

Save this as ec2-host-logs-demo.yaml in the download directory:
The demo-only timestamp transform shifts the sample into roughly the past 24 hours, ending two minutes before ingestion. Use the EC2 instance configuration for your own logs to preserve their original timestamps.
3

Run the demo collector

Set the connection variables, then run from the download directory:
Keep the terminal open while the collector exports the sample, and check its output for errors. Starting a fresh container again can duplicate the sample logs.
4

Verify the demo logs

Open Search, select your Logs source, filter for ServiceName:ec2-demo, and select Last 2 days. Expand a log and check the simulated resource attributes: cloud.region is us-east-1, host.id is i-0abc123def456789, and host.type is t3.medium. Stop the collector with Ctrl+C after verifying the data.

Dashboards and visualization

1

2

Import the dashboard

  1. Open Dashboards and click Import in the upper-right corner.
  2. Upload host-logs-dashboard.json.
  3. Map the charts to your Logs source and click Finish Import.
3

View the dashboard

The imported dashboard displays your logs for the selected time range. To isolate the sample from other services, optionally filter for ServiceName:ec2-demo. Select Last 2 days to see the full sample. You can also filter by EC2 resource attributes such as ResourceAttributes.cloud.region:us-east-1 or ResourceAttributes.host.id:i-0abc123def456789.The dashboard includes log volume, system units, SSH activity, firewall blocks, and service restarts. Severity is unset unless your ingestion pipeline supplies it.
If the SSH activity, Firewall blocks, or untitled security-events charts are empty after filtering for your EC2 service, remove ServiceName = 'host-demo' AND from their aggregation filters if present. Then use the dashboard’s service-name filter to select your EC2 logs.

Troubleshooting

EC2 metadata is missing

Run the metadata check from the EC2 instance. Ensure IMDS is enabled and local firewall or proxy settings allow requests to 169.254.169.254. If you use a proxy, exclude that address with NO_PROXY. Check collector output for metadata detection errors. The demo uses simulated metadata and does not contact IMDS.

No logs appearing

  • Confirm the path in include exists and the collector can read it.
  • Generate new log entries after startup; start_at: end skips existing content.
  • Check collector output for authentication or export errors and confirm the endpoint is reachable from the instance.
  • Verify the Logs source, service-name filter, and time range. Use Last 2 days for the demo.

Logs not parsing correctly

Compare your file’s timestamps with the selected configuration. For traditional syslog, set the correct host time zone. Only collect files matching the configured format.

Next steps

  • Set up alerts for authentication failures or service errors.
  • Filter by EC2 resource attributes to investigate an instance or region.
  • See Sending OpenTelemetry data for deployment guidance.