Mengirim beberapa log ke Simple Log Service dalam satu permintaan.
Deskripsi operasi
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.
Coba sekarang
Test
RAM authorization
Sintaks permintaan
POST /logstores/{logstoreName}/track HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| logstoreName |
string |
Yes |
Nama penyimpanan log. |
ali-test-logstore |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| project |
string |
Yes |
Nama proyek. |
ali-test-project |
| body |
object |
Yes |
Badan permintaan. |
|
| __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. Catatan
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" } |
Hanya header permintaan berikut yang didukung. Dua header permintaan pertama wajib digunakan saat Anda memanggil operasi PutWebTracking. Untuk informasi selengkapnya mengenai format dan deskripsi header permintaan, lihat Header permintaan umum.
-
x-log-apiversion: 0.6.0.
-
x-log-bodyrawsize: 1234.
-
x-log-compresstype: lz4.
Header x-log-compresstype hanya wajib digunakan saat Anda perlu mengirim data terkompresi. Untuk mengirim data terkompresi, Anda harus menggunakan algoritma LZ4 atau DEFLATE. Anda dapat menentukan x-log-compresstype: lz4 atau x-log-compresstype: deflate. Untuk informasi selengkapnya mengenai cara mengompresi data, lihat Kompresi data.
Elemen respons
|
Element |
Type |
Description |
Example |
Tidak ada yang didefinisikan.
Contoh
Respons sukses
JSONformat
{}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.