You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Timed SQL Analysis
Principles of work
Copy page
Download PDF
Principles of work
This topic describes the implementation process, scheduling examples, and basic concepts of scheduled SQL analysis tasks.​
How it works​
Process overview:​
  1. When creating a scheduled SQL analysis task, users must provide basic configuration and configure SQL analysis rules.​
  1. The backend service creates scheduling instances based on the configured time and cycle, and then executes the instances on schedule.​
  • If an instance is delayed, subsequent instances may also be delayed; in this case, the system will catch up, gradually reducing the delay until tasks run on time again.​
  1. Each instance uses the configured query statement to perform query and analysis on the specified log topic, and writes the results into the designated log topic.​
Scheduling example​
For example, if you set the scheduling start time to 10:00:00 on August 17, 2023, with an execution cycle of one hour, an SQL time window of [@h-1h,@h), and a 30-second delay for execution, then: the first instance is scheduled at 11:00:00, runs at 11:00:30, and queries log data within the range [10:00, 11:00).​
Basic concepts​
​
terminologies​
Description​
Scheduled SQL analysis task​
A collection of scheduled SQL analysis rules, including basic configurations such as source and target log topics, scheduling cycles, and SQL analysis rule settings like SQL time windows.​
Instance​
After a scheduled SQL analysis task starts, TLS creates instances on time based on the specified scheduling cycle. Each instance runs scheduled SQL analysis on the source log topic and writes the computed results to the specified log topic.​
Notice​
  • A single task will generate multiple instances over time, but only one instance can run concurrently in a task.​
Scheduling cycle​
The scheduling cycle for scheduled SQL analysis tasks determines the scheduled time for each instance.​
Scheduled time​
By default, the time when the scheduled instance begins execution is determined by the scheduling cycle and is not affected by previous instance timeouts, delays, or reruns.​
If the instance does not meet execution conditions at the scheduled time or delayed execution is set, execution will be postponed.​
Execution time​
The actual execution time of the instance, i.e., the time when the scheduled SQL analysis task instance starts running. By default, the instance runs according to the scheduled time. If delayed execution is set or the previous instance has not finished and other execution conditions are not met, this time will be later than the scheduled time.​
SQL time window​
When running a scheduled SQL analysis task, the time range for log query and analysis uses a left-closed, right-open format. After specifying the SQL time window, TLS initiates scheduled SQL analysis tasks on time based on the defined scheduling cycle and analyzes log data within the designated SQL time window.​
Delayed execution​
Delay time for each scheduled task. When log data volumes are high and collection tasks are busy, writing data to log topics may experience some delay. In this scenario, you can specify a delay time to ensure data integrity during query and analysis.​
​
​
Last updated: 2026.03.16 14:05:02