All Products
Search
Document Center

Simple Log Service:PutWebtracking

Last Updated:Mar 27, 2026

Sends multiple logs to Simple Log Service in one request.

Operation description

Usage notes

  • The information that is required to query logs is obtained. The information includes the name of the project to which the logs belong, the region of the project, and the name of the Logstore to which the logs belong. For more information, see Manage a project and Manage a Logstore.

  • Use this operation to collect logs from web pages or clients.

  • If you use web tracking to collect logs and you do not call this operation, you can send only one log to Simple Log Service in a request. For more information, see Use web tracking to collect logs.

  • If you want to collect a large amount of log data, you can call this operation to send multiple logs to Simple Log Service in one request.

  • Before you can call this operation to send logs to a Logstore, you must enable web tracking for the Logstore. For more information, see Use web tracking to collect logs.

  • You cannot call this operation to send the logs of multiple topics to Simple Log Service at a time.

  • If you call this operation, anonymous users from the Internet are granted the write permissions on the Logstore. This may generate dirty data because AccessKey pair-based authentication is not performed.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /logstores/{logstoreName}/track HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

logstoreName

string

Yes

The name of the Logstore.

ali-test-logstore

Request parameters

Parameter

Type

Required

Description

Example

project

string

Yes

The name of the project.

ali-test-project

body

object

Yes

The request body.

__topic__

string

No

The topic of the logs.

topic

__source__

string

Yes

The source of the logs.

source

__logs__

array<object>

Yes

The logs. Each element is a JSON object that indicates a log.

Note

Note: The time in a log that is collected by using the web tracking feature is the time at which Simple Log Service receives the log. You do not need to configure the __time__ field for each log. If this field exists, it is overwritten by the time at which Simple Log Service receives the log.

object

No

The logs.

string

No

The log content.

{ "key1": "value1", "key2": "value2" }

__tags__

object

No

The tags of the logs.

string

No

The tag of the log.

{ "tag1": "value1", "tag2": "value2" }

Only the following request headers are supported. The first two request headers are required when you call the PutWebTracking operation. For more information about the formats and descriptions of the request headers, see Common request headers.

  • x-log-apiversion: 0.6.0

  • x-log-bodyrawsize: 1234

  • x-log-compresstype: lz4

The x-log-compresstype header is required only when you need to send compressed data. To send compressed data, you must use the LZ4 or DEFLATE algorithm. You can specify x-log-compresstype: lz4 or x-log-compresstype: deflate. For more information about how to compress data, see Data compression.

Response elements

Element

Type

Description

Example

None defined.

Examples

Success response

JSON format

{}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.