- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- Granting LTS Permissions to IAM Users
- Purchasing LTS Resource Packages
- Log Management
-
Log Ingestion
- Overview
-
Using ICAgent to Collect Logs
- Overview
- Installing ICAgent (Intra-Region Hosts)
- Installing ICAgent (Extra-Region Hosts)
- Managing ICAgent
- Managing Host Groups
- Ingesting BMS Text Logs to LTS
- Ingesting CCE Application Logs to LTS
- Ingesting ECS Text Logs to LTS
- Ingesting ServiceStage Containerized Application Logs to LTS
- Ingesting ServiceStage Cloud Host Logs to LTS
- Ingesting Self-Built Kubernetes Application Logs to LTS
- Setting ICAgent Structuring Parsing Rules
-
Ingesting Cloud Service Logs to LTS
- Overview
- Ingesting AOM Logs to LTS
- Ingesting APIG Logs to LTS
- Ingesting CBH Logs to LTS
- Ingesting CFW Logs to LTS
- Ingesting CTS Logs to LTS
- Ingesting DDS Logs to LTS
- Ingesting DMS for Kafka Logs to LTS
- Ingesting DRS Logs to LTS
- Ingesting GaussDB(DWS) Logs to LTS
- Ingesting ELB Logs to LTS
- Ingesting Enterprise Router Logs to LTS
- Ingesting FunctionGraph Logs to LTS
- Ingesting GaussDB Logs to LTS
- Ingesting GES Logs to LTS
- Ingesting TaurusDB Logs to LTS
- Ingesting GeminiDB Logs to LTS
- Ingesting GeminiDB Mongo Logs to LTS
- Ingesting GeminiDB Cassandra Logs to LTS
- Ingesting IoTDA Logs to LTS
- Ingesting ModelArts Logs to LTS
- Ingesting MRS Logs to LTS
- Ingesting RDS for MySQL Logs to LTS
- Ingesting RDS for PostgreSQL Logs to LTS
- Ingesting RDS for SQL Server Logs to LTS
- Ingesting ROMA Connect Logs to LTS
- Ingesting SMN Logs to LTS
- Ingesting SecMaster Logs to LTS
- Ingesting OBS Files to LTS (Beta)
- Ingesting VPC Logs to LTS
- Ingesting WAF Logs to LTS
- Using APIs to Ingest Logs to LTS
- Ingesting Logs to LTS Across IAM Accounts
- Using Kafka to Report Logs to LTS
- Using Flume to Report Logs to LTS
- Log Search and Analysis
-
Log Visualization
- Overview
- Visualizing Logs in Statistical Charts
-
Visualizing Logs in Dashboards
- Creating a Dashboard
- Adding a Dashboard Filter
-
Dashboard Templates
- APIG Dashboard Templates
- CCE Dashboard Templates
- CDN Dashboard Templates
- CFW Dashboard Templates
- CSE Dashboard Templates
- DCS Dashboard Template
- DDS Dashboard Template
- DMS Dashboard Template
- DSL Dashboard Template
- ER Dashboard Template
- METRIC Dashboard Template
- Nginx Dashboard Templates
- VPC Dashboard Template
- WAF Dashboard Templates
- Log Alarms
- Log Transfer
- Log Processing
- Configuration Center
- Querying Real-Time LTS Traces
-
Best Practices
- Overview
-
Log Ingestion
- Collecting Logs from Third-Party Cloud Vendors, Internet Data Centers, and Other Huawei Cloud Regions to LTS
- Collecting Kubernetes Logs from Third-Party Clouds, IDCs, and Other Huawei Cloud Regions to LTS
- Collecting Syslog Aggregation Server Logs to LTS
- Importing Logs of Self-built ELK to LTS
- Using Flume to Report Logs to LTS
- Collecting Zabbix Data Through ECS Log Ingestion
- Collecting Logs from Multiple Channels to LTS
- Log Search and Analysis
- Log Transfer
- Billing
- Developer Guide
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- API Calling Examples
- Examples
-
APIs
- Host Group Management
- Log Group Management
- Log Stream Management
- Log Management
- Log Ingestion
- Log Transfer
- Log Collection Beyond Free Quota
- Cloud Log Structuring
- Container Log Ingestion from AOM to LTS
- Alarm Topics
- Message Template Management
- SQL Alarm Rules
- Keyword Alarm Rules
- Alarm List
- Tag Management
- Dashboard Management
- Log Charts
- Quick Search
- Multi-Account Log Aggregation
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
FAQs
- Overview
- Consultation
- Log Management
-
Host Management
- What Do I Do If ICAgent Installation Fails in Windows and the Message "SERVICE STOP" Is Displayed?
- What Do I Do If ICAgent Upgrade Fails on the LTS Console?
- What Do I Do If I Could Not Query New Logs on LTS?
- What Do I Do If ICAgent Restarts Repeatedly After Being Installed?
- What Do I Do If ICAgent Is Displayed as Offline on the LTS Console After Installation?
- What Do I Do If I Do Not See a Host with ICAgent Installed on the LTS Console?
- How Do I Create a VPC Endpoint on the VPCEP Console?
- How Do I Obtain an AK/SK Pair?
- How Do I Install ICAgent by Creating an Agency?
-
Log Ingestion
- What Do I Do If LTS Cannot Collect Logs After I Configure Host Log Ingestion?
- Will LTS Stop Collecting Logs After the Free Quota Is Used Up If I Disable "Continue to Collect Logs When the Free Quota Is Exceeded" in AOM?
- What Do I Do If the CPU Usage Is High When ICAgent Is Collecting Logs?
- What Kinds of Logs and Files Does LTS Collect?
- How Do I Disable the Function of Collecting CCE Standard Output Logs to AOM on the LTS Console?
- What Log Rotation Scheme Should I Use for ICAgent to Collect Logs?
- Does LTS Use the Log4j Plug-in to Report Logs?
- How Long Does It Take to Generate Logs After Configuring Log Ingestion?
- What Do I Do If LTS Cannot Collect Logs After I Configure Log Ingestion with ICAgent?
- Log Search and Analysis
-
Log Transfer
- Does LTS Delete Logs That Have Been Transferred to OBS Buckets?
- What Are the Common Causes of LTS Log Transfer Abnormalities?
- How Do I Transfer CTS Logs to an OBS Bucket?
- What Do I Do If I Cannot View Historical Data in an OBS Bucket After Transferring Data from LTS to OBS?
- What Do I Do If I Cannot Find a New Partition in a DLI Table After Logs Are Transferred to DLI?
-
More Documents
- User Guide (ME-Abu Dhabi Region)
- API Reference (ME-Abu Dhabi Region)
- User Guide(Paris Regions)
- API Reference(Paris Regions)
- User Guide (Kuala Lumpur Region)
- API Reference (Kuala Lumpur Region)
- User Guide (Ankara Region)
-
API Reference (Ankara Region)
- Before You Start
- Calling APIs
- API Calling Examples
- APIs
- Permissions and Supported Actions
- Appendix
- Change History
- Videos
- General Reference
Copied.
Collecting Traffic Statistics on Top N Log Groups or Log Streams
Function
Collect traffic statistics on top N log groups or log streams.
URI
POST /v2/{project_id}/lts/topn-traffic-statistics
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining the Account ID, Project ID, Log Group ID, and Log Stream ID. Minimum length: 1 character. Maximum length: 64 characters. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. Minimum length: 1000 characters. Maximum length: 2000 characters. |
Content-Type |
Yes |
String |
Set this parameter to application/json;charset=UTF-8. Minimum length: 30 characters. Maximum length: 30 characters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
end_time |
Yes |
Long |
End timestamp, in milliseconds. |
is_desc |
Yes |
Boolean |
Whether to sort data in descending order (true or false). |
resource_type |
Yes |
String |
Resource type: The value is log_group / log_stream / tenant. |
sort_by |
Yes |
String |
Sorting criteria: index, write, or storage. The value must exist in search_list. |
start_time |
Yes |
Long |
Start timestamp of the query, in milliseconds. A maximum of 30 days are supported. |
topn |
Yes |
Integer |
Number of data records to be queried. The value ranges from 1 to 100. |
filter |
Yes |
Map<String,String> |
Filter criteria { "log_group_id": "xxxxxx" }Filter is in the map structure. The key is the filtering attribute, and the value is the attribute value. Fuzzy match is not supported. |
search_list |
Yes |
Array of strings |
Query data type. Multiple string arrays can be used together. This parameter can be set only to index, write, or storage. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
results |
Array of ResultsTopnBody objects |
Response result. |
Parameter |
Type |
Description |
---|---|---|
index_traffic |
Double |
Index traffic, in bytes. This parameter is returned when the queried data type contains index. |
storage |
Double |
Storage capacity, in bytes. This parameter is returned when the queried data type contains storage. |
write_traffic |
Double |
Write traffic, in bytes. This parameter is returned when the queried data type contains write. |
log_group_id |
String |
Log group ID. This parameter is returned when the resource type is log group. |
log_group_name |
String |
Log group name. This parameter is returned when the resource type is log group. |
log_stream_id |
String |
Log stream ID. This parameter is returned when the resource type is log stream. |
log_stream_name |
String |
Log stream name. This parameter is returned when the resource type is log stream. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. Minimum length: 8 characters. Maximum length: 36 characters. |
errorMessage |
String |
Error description. Minimum length: 2 characters. Maximum length: 512 characters. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
errorCode |
String |
Error code. Minimum length: 8 characters. Maximum length: 36 characters. |
errorMessage |
String |
Error description. Minimum length: 2 characters. Maximum length: 512 characters. |
Example Requests
/v2/2a473356cca5487f8373be891bffc1cf/lts/topn-traffic-statistics { "sort_by" : "storage", "is_desc" : true, "resource_type" : "log_stream", "filter" : { }, "start_time" : 1668668183969, "end_time" : 1669272983969, "search_list" : [ "index", "write", "storage" ], "topn" : 100 }
Example Responses
Status code: 200
Query succeeded.
{ "results" : [ { "index_traffic" : 0, "log_stream_id" : "6fd93d47-7630-4284-a622-311d0082f6bb", "log_stream_name" : "cmdb-cce-cluster", "storage" : 59810657587, "write_traffic" : 0 }, { "index_traffic" : 0, "log_stream_id" : "504ec3dd-ac28-4783-babb-22a49f36afe3", "log_stream_name" : "CMSkaifatest", "storage" : 20033606015, "write_traffic" : 0 }, { "index_traffic" : 6825703991, "log_stream_id" : "a14dacb0-5a13-43a8-89a3-ea5424d95133", "log_stream_name" : "ELB", "storage" : 15659303771, "write_traffic" : 1.3651407982E9 }, { "index_traffic" : 302172889, "log_stream_id" : "25fe7494-7395-438e-8340-647613673ffa", "log_stream_name" : "LTStest-916-statefulset", "storage" : 316552589, "write_traffic" : 6.04345778E7 }, { "index_traffic" : 0, "log_stream_id" : "956586fc-b828-44be-8672-0a323962a8fa", "log_stream_name" : "mongodb_slow", "storage" : 0, "write_traffic" : 0 } ] }
Status code: 400
Invalid request. Modify the request based on the description in error_msg before a retry.
{ "errorCode" : "LTS.0208", "errorMessage" : "The log stream does not existed" }
Status code: 500
The server has received the request but encountered an internal error.
{ "errorCode" : "LTS.0203", "errorMessage" : "Internal Server Error" }
Status Codes
Status Code |
Description |
---|---|
200 |
Query succeeded. |
400 |
Invalid request. Modify the request based on the description in error_msg before a retry. |
500 |
The server has received the request but encountered an internal error. |
Error Codes
See Error Codes.
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