Data collection

更新时间:
复制 MD 格式

Choose a collection method based on your deployment environment. To collect historical data instead of streaming logs, see data import.

Data collection methods

Simple Log Service transfers and stores your target data so you can query and analyze it, run data processing to transform its format and content, or consume and ship data to third-party systems.

Important

All collection methods support only incremental data collection. To collect historical data, use data import.

Two primary collection agents are available:

  • LoongCollector (formerly Logtail): The next-generation log collection agent from Simple Log Service. Deploy it on servers, Kubernetes nodes, or Docker hosts to collect logs from files without modifying application code. It is backward-compatible with Logtail and delivers enhanced performance.

  • SDK-based collection: Use the Simple Log Service SDKs or APIs to write logs directly from your application code. This gives you the most flexibility for custom collection logic.

Collection solutions for Kubernetes

If your applications run in Kubernetes, choose one of the following methods:

Collection solutions for hosts and servers

If your applications run on Alibaba Cloud ECS instances, servers in self-managed data centers, or other cloud servers, choose one of the following methods:

  • Continuously collect text logs from hosts: LoongCollector supports multiple log formats including Nginx, JSON, Apache, IIS, and delimiter-separated formats. Note the relationship between your servers and your Simple Log Service project, as it determines how the agent is installed.

  • Collect host monitoring data (metrics): Collect CPU, memory, load, disk, and network metrics from your hosts.

  • Collect Windows event logs: Simple Log Service uses Windows APIs to subscribe to Windows event channels and continuously collect event logs published by applications and the kernel.

Collection solutions for Docker

If your applications run in Docker containers, choose one of the following methods:

Alibaba Cloud service collection

Alibaba Cloud service log collection: Simple Log Service can collect logs from Alibaba Cloud services across elastic computing, storage, security, and database categories. These logs include operational events, running status, and business activity records.

Collection solutions for middleware

Integration with third-party ecosystems

  • Integrate with other open-source agents and protocols to collect logs: Simple Log Service accepts logs from a range of open-source tools and protocols:

    • Use the Loggie sink configuration to upload collected logs to Simple Log Service.

    • Use the Log4j2 Appender to send logs directly from your Java application.

    • Use Syslog-ng to collect logs and forward them over the Syslog protocol.

    • Use tools such as the Kafka Producer SDK, the Beats family of shippers, Collectd, Fluentd, Logstash, Telegraf, and Vector to collect logs and upload them to Simple Log Service over the Kafka protocol.

  • Integrate Telegraf monitoring data: Write monitoring data collected by Telegraf (from MySQL, Redis, Elasticsearch, ClickHouse, Kafka, Tomcat, and others) to LoongCollector using the InfluxDB protocol. LoongCollector then uploads the data to Simple Log Service.

  • Collect Open-Falcon monitoring data: Configure Transfer to upload Open-Falcon data to Simple Log Service. Your Open-Falcon version must include the InfluxDB support feature.

  • Ingest Prometheus monitoring data by using the Remote Write protocol: Enable the Remote Write feature in Prometheus to send monitoring data directly to Simple Log Service.

SDK collection

SDK-based collection: Simple Log Service provides SDKs for Java, Python, PHP, Node.js, C, Go, iOS, Android, and C++. Use these SDKs to write logs or write time-series data.

Data import

Import existing data from other applications or historical files into Simple Log Service for analysis.

Data masking and encryption

Advanced collection scenarios

  1. Collect logs cross-region: Your application runs in region A and your Simple Log Service project is in region B. This solution explains how to send logs from an ECS instance in region A to the project in region B.

  2. Collect logs cross-account: Centrally collect logs from applications running under separate accounts into a single account for unified management.

  3. Collect IoT and embedded device logs: IoT devices such as smart routers, TV sticks, Tmall Genie, and cleaning robots are numerous, widely distributed, difficult to debug, and constrained by hardware. This solution explains how to handle log collection from these devices.

  4. High-availability solutions for client-side data collection: Two active-active, geo-redundant solutions to reduce the risk of single-cluster failures: a dual-write solution and a data replication and write-switching solution.

  5. Collect logs from servers on an internal network: If your servers have no public network access, use a proxy to collect logs and forward them to Simple Log Service.

For more solutions, see Data collection best practices.

FAQ