Alibaba Cloud Trigger

Alibaba Cloud Trigger

Certified

Trigger on new logs in Alibaba Cloud Simple Log Service (SLS)

Consumes new SLS log groups using shard cursors persisted in namespace KV. Late-arriving logs are consumed by ingestion position, independently of their event timestamps.

yaml
type: io.kestra.plugin.alibaba.sls.Trigger

React to error logs in SLS

yaml
id: sls_on_errors
namespace: company.team

triggers:
  - id: on_errors
    type: io.kestra.plugin.alibaba.sls.Trigger
    accessKeyId: "{{ secret('ALIBABA_ACCESS_KEY_ID') }}"
    accessKeySecret: "{{ secret('ALIBABA_ACCESS_KEY_SECRET') }}"
    region: cn-hangzhou
    project: ops-logs
    logstore: app-events
    query: "* | where level == 'ERROR'"
    fetchType: STORE
    interval: PT1M

tasks:
  - id: alert
    type: io.kestra.plugin.core.log.Log
    message: "{{ trigger.count }} error logs received"
Properties

The AccessKey ID

The AccessKey Secret

Logstore

The SLS Logstore name.

Project

The SLS project name.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Endpoint override

DefaultFETCH
Possible Values
STOREFETCHFETCH_ONENONE

Result handling mode

FETCH or STORE; defaults to FETCH. FETCH accumulates the complete matching backlog in memory and execution variables. Use STORE for high-volume logstores, long lookback windows, or catch-up after downtime; STORE writes results incrementally to internal storage.

DefaultPT1M
Formatduration

Polling interval

Interval between query runs; defaults to 60 seconds.

DefaultPT5M

Initial lookback duration

Lookback duration when no prior cursor exists in the KV store; defaults to 5 minutes.

Default

Query

SPL consumption filter, such as * | where level == 'ERROR'. Defaults to empty. Index search syntax and SQL analysis are not supported.

Region

Region used to derive the endpoint when endpointOverride is absent.

Security Token

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Default

Topic

Topic filter.

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Total number of log records returned

First fetched log item as a key-value map

Only populated if fetchType is FETCH_ONE

SubTypeobject

Fetched logs as a list of key-value maps

Only populated if fetchType is FETCH

Formaturi

URI of the stored results in internal storage

Only populated if fetchType is STORE