UpdateLogs

Updated at:
Copy as MD

Updates log data in a specified Logstore under the specified Project.

Operation description

The Host consists of the Project name and the Log Service endpoint. You need to specify the Project in the Host.

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/{logstore}/updatelogs HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

logstore

string

No

The name of the Logstore.

ali-test-logstore

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

Request body

from

integer

Yes

The start time of the query. This time refers to the log time specified when the log data was written.

The time range defined by the request parameters from and to follows the left-closed, right-open principle. That is, the time range includes the start time but does not include the end time. If the values of from and to are the same, the range is invalid and the function returns an error directly. Unix timestamp format, representing the number of seconds since 1970-01-01 00:00:00 UTC.

1627268185

to

integer

Yes

The end time of the query. This time refers to the log time specified when the log data was written.

The time range defined by the request parameters from and to follows the left-closed, right-open principle. That is, the time range includes the start time but does not include the end time. If the values of from and to are the same, the range is invalid and the function returns an error directly. Unix timestamp format, representing the number of seconds since 1970-01-01 00:00:00 UTC.

1627268200

query

string

No

Optional: A query statement used to filter the logs to be updated. For more information, see Query overview.

Note: This parameter only supports query statements and does not support analysis statements such as SPL or SQL.

status: 401

rowId

string

No

Optional: The value of the built-in field rowid that is automatically returned in the query results.

One of the two fields, rowId and query, must be specified. If both are specified, rowId takes higher priority.

0|1000001|638732499

updateMode

string

No

Optional: The value can be full or partial. The default value is partial.

  • full —— The request body must contain all fields of the row. The server overwrites the entire old record with the new values.

  • partial —— The request body only needs to contain the fields to be modified. Fields that are not provided retain their original values.

partial

data

string

No

The data to be updated, in JSON format.

{"status":"success"}

project

string

No

The name of the Project.

ali-project-test

Response elements

Element

Type

Description

Example

object

Schema of Response

affectedRows

integer

The number of updated log rows.

10

Examples

Success response

JSON format

{
  "affectedRows": 10
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.