Logs are a special type of data that plays an important role in processing historical data and diagnosing problems. Logs are essential data sources for data analysts, developers, and O&M personnel. Alibaba Cloud allows you to use Log Service to synchronize logs such as NGINX access logs, Log4j logs, Apache access logs, and structured text to AnalyticDB for MySQL in real time. This allows you to use AnalyticDB for MySQL to perform real-time log analytics.
Prerequisites
- When you use Log Service for the first time, you must use your Alibaba Cloud account
to log on to the Log Service buy page and click Get it Free. The system automatically redirects you to the buy page. Read and select I agree
with Log Service Agreement of Service and click Enable Now. The Log Service console appears.
Note If you have activated Log Service, you can start to create a project.
- Before you use AnalyticDB for MySQL, make sure that the following requirements are
met:
- An AnalyticDB for MySQL cluster is created. For more information, see Create a cluster.
- A database account is created. For more information, see Create a database account.
- A database is created. For more information, see Create a database.
- A public endpoint is applied for if you must use a public endpoint to connect to AnalyticDB for MySQL clusters. For more information, see Apply for or release a public endpoint.
- A table is created by using the CREATE TABLE statement to store the log data transferred to AnalyticDB for MySQL. For more information, see CREATE TABLE.
Create a LogShipper task
You can use the Export function in the Data Transformation module of Log Service to transfer the collected logs in Logstores to AnalyticDB for MySQL.
View log data
After logs are transferred to AnalyticDB for MySQL, you can execute the SELECT statement to analyze log data. For more information, see Syntax.
Manage a LogShipper task
- You can click the task name to view the execution status of the LogShipper task. For example, you can view the amount of data that is transferred and fails to be transferred and delivery latency.
- To modify a LogShipper task, click Modify LogShipper.
- To restart a LogShipper task, first click Stop. After the LogShipper task is stopped, click Start to restart the LogShipper task.