Collecting Logs Using APIs
You can report logs to LTS with REST APIs. LTS supports APIs for reporting logs and high-precision logs.
The application scenarios and access IP addresses of the APIs are as follows:
Name |
Log Time |
Example |
Scenario |
---|---|---|---|
When invoking the API to upload a batch of logs, you can specify an initial time with log_time_ns field. Time of each log can be calculated with log_time_ns+sequence count. |
{ "log_time_ns": "1586850540000000000", "contents": [ "log1", "log2" ], "labels": { "user_tag": "string" } } When reported to LTS: The time of log1 is 1586850540000000000. The time of log2 is 1586850540000000001. |
The logs are generated in sequence at similar time. |
|
When you invoke the API to upload a batch of logs, the log_time_ns field must be used to specify the log time for each log. |
{ "contents":[ { "log_time_ns":"1586850540000000000", "log":"log3" }, { "log_time_ns":"1586850540000000008", "log":"log4" } ], "labels":{ "user_tag":"string" } } When reported to LTS: The time of log3 is 1586850540000000000. The time of log4 is 1586850540000000008. |
The uploaded logs are generated out of order at different times. Each log needs to have its own timestamp. |
Region |
Access IP address |
---|---|
CN North-Beijing1 |
100.125.57.101 |
CN North-Beijing2 |
100.125.6.108 |
CN North-Beijing4 |
100.125.12.150 |
CN East-Shanghai1 |
100.125.11.177 |
CN East-Shanghai2 |
100.125.140.102 |
CN South-Guangzhou |
100.125.158.115 |
CN Southwest-Guiyang1 |
100.125.0.27 |
CN South-Guangzhou-InvitationOnly |
100.125.4.30 |
AP-Singapore |
100.125.4.58 |
You can log in to the LTS console. In the navigation pane, choose Host Management, and click Install ICAgent to get the access IP address.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot