This topic describes how to collect the logs of an Alibaba Cloud Elastic Compute Service (ECS) instance in the Log Service console. This topic also describes how to query and analyze the collected logs.
Prerequisites
- An ECS instance is available. For more information, see ECS quick start.
- Logs are available on the ECS instance.
Background information
127.0.0.1|#|-|#|13/Apr/2020:09:44:41 +0800|#|GET /1 HTTP/1.1|#|0.000|#|74|#|404|#|3650|#|-|#|curl/7.29.0
. The delimiter mode is used in this example to collect the sample log entry. For
more information, see Collect logs in delimiter mode.
Step 1: Activate Log Service
- Log on to the Log Service console.
- Activate Log Service as prompted.
Step 2: Create a project and a Logstore
Step 3: Collect logs
Step 4: Query and analyze logs
FAQ
- Am I charged if I only create projects and Logstores?
Log Service provides shards to read and write data. By default, shard resources are reserved when you create a Logstore. You are charged for active shards. For more information, see Why am I charged for active shards?
- What do I do if logs fail to be collected?
When you use Logtail to collect logs, a failure may occur due to Logtail heartbeat failures, collection errors, or invalid Logtail configurations. For more information, see Troubleshoot collection errors.
- What do I do if I can query logs but cannot analyze logs on the query and analysis
page of a Logstore?
If you want to analyze logs, you must configure indexes for log fields and turn on the switches in the Enable Analytics column. For more information, see Configure indexes.