All Products
Search
Document Center

Simple Log Service:GetMLServiceResults

Last Updated:Sep 18, 2026

Provides intelligent analysis capabilities for basic data (Log, Metric, Trace) on the Simple Log Service platform. You can invoke related models to directly obtain analysis results. Currently, the supported nodes include: Named Entity Recognition (NER) for log data, outlier detection for time series data, and root cause span identification for high-latency trace data.

Operation description

This API operation is available only at the China (Shanghai) and Singapore endpoints. The following basic permissions are required:

{
    "Version": "1",
    "Statement": [
        {
            "Action": [
                "log:Get*"
            ],
            "Resource": [
                "acs:log:*:*:mlservice/sls_builtin_*"
            ],
            "Effect": "Allow"
        }
    ]
}

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

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

log:GetMLServiceResults

none

*All Resource

*

None None

Request syntax

POST /ml/service/{serviceName}/analysis HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

serviceName

string

No

The service name.

Valid values:

  • sls_builtin_service_trace_rca :

    the service name for high-latency trace request path analysis.

  • sls_builtin_service_log_struct :

    the service name for LogNER.

  • sls_builtin_service_metric_anomaly :

    the service name for single-dimension time series outlier detection.

sls_builtin_service_log_struct

Request parameters

Parameter

Type

Required

Description

Example

allowBuiltin

boolean

No

  • true: The request is allowed to use built-in services.

  • false: The request is not allowed to use built-in services.

Valid values:

  • true :

    Allows the use of built-in services.

  • false :

    Does not allow the use of built-in services.

true

version

string

No

The version of the algorithm. Different versions correspond to different algorithms.

v1

body MLServiceAnalysisParam

No

The request struct.

Valid values:

  • others :

    The description varies depending on the value of serviceName.

The request parameters vary depending on the scenario. Details are as follows:

Log content entity recognition (sls_builtin_service_log_struct)

Content related to body.parameter

{
  "is_struct": "true",
  "use_gpu": "true/false",
  "max_fields": "1"
}
  • When is_struct is set to true, the log format is a JSON structure. Currently, only the value true is supported.

  • use_gpu specifies whether to use GPU resources.

  • max_fields specifies the maximum number of fields to analyze when the log format is a JSON structure. By default, only one field is analyzed.

Content related to body.input

[
  {
    "{column_name}": "{column_value}"
  }
]

The input is a JSON array, where:

  • column_name specifies the name of a field in the JSON-structured log.

  • column_value specifies the value of a field in the JSON-structured log.

Time series outlier detection (sls_builtin_service_metric_anomaly)

Content related to body.parameter

{
  "isOrdered": "true/false",
  "keys": "[]",
  "timeColumnName": "",
  "analysisColumnNames": "[]",
  "interval": "-1"
}
  • isOrdered specifies whether the input data is ordered. Set this parameter to true if the input sequence is sorted in ascending order by time. Otherwise, set it to false.

  • interval specifies the interval of the time series in seconds. For example, if the sequence has one data point per minute, set this parameter to 60. If the interval is unknown, set it to -1.

  • timeColumnName specifies the name of the time dimension in the input sequence.

  • analysisColumnNames specifies the names of the numeric feature dimensions to analyze in the input sequence. Use an array and serialize it into a string.

  • keys specifies the column names of the input data. Use an array and serialize it into a string.

Content related to body.input

[
  {
    "{column_name}": "{column_value}"
  }
]

The input is an array, where:

  • column_name specifies the name of a field in the sequence.

  • column_value specifies the value of a field in the sequence. When {column_name} equals {timeColumnName}, the value represents the time as a UNIX timestamp, in seconds.

High-latency trace data detection (sls_builtin_service_trace_rca)

Content related to body.parameter

{
  "project": "",
  "logstore": "",
  "endpoint": "",
  "role_arn": ""
}
  • project specifies the name of the project in Simple Log Service where the trace data to analyze is stored.

  • logstore specifies the name of the Logstore in Simple Log Service where the trace data to analyze is stored.

  • endpoint specifies the endpoint of the region where the project resides. Use a public endpoint because internal endpoints are not accessible.

  • role_arn specifies the ARN of the role that has been authorized to access the resource. Use the ARN of ETLRole or AuditRole.

Content related to body.input

[
  {
    "service": "",
    "name": "",
    "from_ts_sec": "",
    "to_ts_sec": "",
    "slo_ts_micro": "",
    "batch_id": "",
    "trace_ids": "[]"
  }
]

The input is an array with a length of 1. The parameters are described as follows:

  • service specifies the service name of one or a batch of trace IDs to diagnose. You can obtain this value from the Logstore.

  • name specifies the operation name of one or a batch of trace IDs to diagnose. You can obtain this value from the Logstore.

  • from_ts_sec specifies the start UNIX timestamp of the analysis period, in seconds.

  • to_ts_sec specifies the end UNIX timestamp of the analysis period, in seconds.

  • batch_id specifies the name of the current batch of trace IDs to analyze.

  • trace_ids specifies the list of trace IDs in the current request. Serialize the list into a string by using JSON serialization.

Response elements

Element

Type

Description

Example

object

The response struct.

Valid values:

  • 无 :

    None.

  • None :

    None

data

array<object>

The returned data.

object

The dataset struct.

string

The returned results.

{'marker': ''}

status

object

The status of the task.

Valid values:

  • 无 :

    None.

  • None :

    None

string

Empty by default, which indicates that tasks in all statuses are returned. Valid values: success, fail, and running.

Valid values:

  • 无 :

    None.

  • None :

    None

200

The response elements vary depending on the scenario. Details are as follows:

Log content entity recognition (sls_builtin_service_log_struct)

Content related to data

[
  {
    "{column_name}": "{column_value}"
  }
]

Each JSON object in the output corresponds to a JSON-structured log in the input, where:

  • column_name specifies the name of an analyzed field in the JSON-structured log. A maximum of max_fields fields are analyzed.

  • column_value specifies the value of an analyzed field in the JSON-structured log. NER results in the field value are wrapped with the tags <ml_ner_${ner_type}></ml_ner_${ner_type}>, where ${ner_type} is the specific NER type.

Time series outlier detection (sls_builtin_service_metric_anomaly)

Content related to data

[
  {
    "start": "",
    "end": "",
    "label": ""
  }
]
  • start specifies the start time of the detected anomaly interval.

  • end specifies the end time of the detected anomaly interval.

  • label specifies the anomaly type of the current interval. Valid values:
    • SPIKE_UP_TYPE

    • SPIKE_DOWN_TYPE

    • TREND_UP_TYPE

    • TREND_DOWN_TYPE

    • MEANSHIFT_UPWARD_TYPE

    • MEANSHIFT_DOWNWARD_TYPE

High-latency trace data detection (sls_builtin_service_trace_rca)

Content related to data

[
  {
    "traceID": "",
    "service": "",
    "name": "",
    "rootCauses": "[{}]"
  }
]
  • traceID specifies the trace ID to detect.

  • service specifies the service name of the root span of the trace.

  • name specifies the operation name of the root span of the trace.

  • rootCauses specifies the list of spans that cause high latency in the trace, represented as a serialized string. The deserialized structure of this field is as follows:

[
  {
    "spanID": "",
    "service": "",
    "name": "",
    "host": "xxxx",
    "predicateDuration": 10
  }
]

Examples

Success response

JSON format

{
  "data": [
    {
      "key": "{'marker': ''}"
    }
  ],
  "status": {
    "key": "200"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.