Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Reporting High-Precision Logs

Updated on 2023-12-01 GMT+08:00

Function

This API is used to report tenant logs from a host to LTS.

To obtain the access IP address, log in to the LTS console, choose Host Management in the navigation pane, and click Install ICAgent in the upper right corner. The access IP address is contained in the ICAgent installation command. The port number is 8102. You can check the Example Request to see how to add the access IP address and port number in a request.

NOTE:

Each log event will carry a nanosecond-level timestamp when it is reported. When you view logs on the LTS console, the log events are sorted by timestamp.

URI

POST /v2/{project_id}/lts/groups/{log_group_id}/streams/{log_stream_id}/tenant/contents/high-accuracy

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see .

No default value.

Value length: 32 characters

log_group_id

Yes

String

Log group ID. For details about how to obtain the log group ID, see .

No default value.

Value length: 36 characters

log_stream_id

Yes

String

Log stream ID. For details about how to obtain the log stream ID, see .

No default value.

Value length: 36 characters

The write rate at most should not exceed 100 MB/s for a single log stream. Otherwise, logs may be lost.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Indicates the user token obtained from IAM.

No default value.

Minimum length: 1000 characters

Maximum length: 2000 characters

Content-Type

Yes

String

Set this parameter to application/json;charset=UTF-8.

Default value: None

Minimum length: 30 characters

Maximum length: 30 characters

Content-Encoding

No

String

Log compression format.

Enumerated values:

  • GZIP
  • SNAPPY
  • gzip
  • snappy
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

contents

Yes

Array of LogContents

Indicates a list of log events that carry reporting timestamps.

labels

Yes

Object

Custom labels.

tenant_project_id

No

String

Tenant ID.

Table 4 LogContents

Parameter

Mandatory

Type

Description

log_time_ns

Yes

Long

Indicates the log collection time (UTC time in nanoseconds).

NOTE:

The interval between the log collection time and current time must be less than the log retention duration. Otherwise, reported logs will be cleared. For example, if the log retention duration is seven days, the log collection time must be within the last seven days.

log

Yes

String

Indicates the log content.

Response Parameters

When the status code is 200, the response parameters are as follows:

Table 5 Response body parameters

Parameter

Type

Description

errorCode

String

Indicates the status code.

Example value:

  • SVCSTG.ALS.200.200

errorMessage

String

Indicates the response description.

Example value:

  • Report success.

result

String

Response result.

When the status code is 400, the response parameters are as follows:

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Indicates the error code.

Example value:

  • SVCSTG.ALS.200.201
  • SVCSTG.ALS.200.210

errorMessage

String

Indicates the error description.

Example value:

  • Request conditions must be json format.
  • projectid xxx log's quota has full!!

result

String

Response result.

When the status code is 401, the response parameters are as follows:

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Indicates the error code.

Example value:

  • SVCSTG.ALS.403.105

errorMessage

String

Indicates the error description.

Example value:

  • Project id is invalid.

result

String

Response result.

When the status code is 500, the response parameters are as follows:

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Indicates the error code.

Example value:

  • SVCSTG.ALS.403.105

errorMessage

String

Indicates the error description.

Example value:

  • Internal error

result

String

Response result.

When the status code is 503, the response parameter is as follows:

Table 9 Response body parameter

Parameter

Type

Description

result

String

The requested service is unavailable.

Example Request

POST https://{access_IP_address:8102}/v2/{project_id}/lts/groups/{log_group_id}/streams/{log_stream_id}/tenant/contents/high-accuracy

{
	"contents": [
		{
			"log_time_ns": "1586850540000000000",
			"log": "Fri Feb  15 15:48:04 UTC 2019"
		},
		{
			"log_time_ns": "1586850540000000001",
			"log": "Sat Apri 18 16:04:04 UTC 2019"
		}
	],
	"labels": {
		"user_tag": "string"
	}
}

Example Response

Example response with status code 200:

Logs are reported.

{
  "errorCode": "SVCSTG.ALS.200.200",
  "errorMessage": "Report success.",
  "result": null
}

Example response with status code 401:

The authentication information is incorrect or invalid.

{
  "errorCode" : "SVCSTG.ALS.403.105",
  "errorMessage" : "Project id is invalid.",
  "result": null
}

Status Code

Status Code

Description

200

The request has succeeded.

400

The request is invalid. Modify the request based on the description in error_msg before a retry.

401

The authentication information is incorrect or invalid.

500

An internal error occurred.

503

The requested service is unavailable.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback