All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::SLS::Savedsearch

Last Updated:Aug 25, 2026

The ALIYUN::SLS::Savedsearch resource type is used to save a query as a saved search.

Syntax

{
  "Type": "ALIYUN::SLS::Savedsearch",
  "Properties": {
    "Project": String,
    "Detail": Map
  }
}

Properties

Property name

Type

Required

Updates allowed

Description

Constraints

Project

String

Yes

No

The name of the project.

None

Detail

Map

Yes

Yes

The details of the query.

For more information, see Detail properties.

Detail syntax

"Detail": {
  "SearchQuery": String,
  "Logstore": String,
  "DisplayName": String,
  "SavedsearchName": String,
  "Topic": String
}

Detail properties

Property name

Type

Required

Updates allowed

Description

Constraints

SearchQuery

String

Yes

Yes

The query statement.

None

Logstore

String

Yes

Yes

The Logstore.

None

DisplayName

String

No

Yes

The display name of the saved search.

The name must be 1 to 63 characters in length.

SavedsearchName

String

Yes

No

The name of the saved search.

None

Topic

String

Yes

Yes

The topic of the log.

None

Return values

Fn::GetAtt

SavedsearchName: The name of the saved search.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SlsProjectName:
    Type: String
    Description: Project name
    MinLength: 3
    MaxLength: 63
    Default: mytest
Resources:
  SavedSearch:
    Type: ALIYUN::SLS::Savedsearch
    Properties:
      Project:
        Ref: SlsProjectName
      Detail:
        SearchQuery: '*|select date_format(__time__-__time__%60, ''%H:%i:%s'') as time, COUNT(*) as pv group by time'
        Logstore: aliyun-test-***
        DisplayName: displayname
        SavedsearchName: test
        Topic: test

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SlsProjectName": {
      "Type": "String",
      "Description": "Project name",
      "MinLength": 3,
      "MaxLength": 63,
      "Default": "mytest"
    }
  },
  "Resources": {
    "SavedSearch": {
      "Type": "ALIYUN::SLS::Savedsearch",
      "Properties": {
        "Project": {
          "Ref": "SlsProjectName"
        },
        "Detail": {
          "SearchQuery": "*|select date_format(__time__-__time__%60, '%H:%i:%s') as time, COUNT(*) as pv group by time",
          "Logstore": "aliyun-test-***",
          "DisplayName": "displayname",
          "SavedsearchName": "test",
          "Topic": "test"
        }
      }
    }
  }
}