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

Torch Log Service

Copy page
Download PDF
Machine learning function
Anomaly comparison function
Copy page
Download PDF
Anomaly comparison function
This topic describes the syntax of anomaly comparison functions supported by TLS and provides usage examples for common scenarios.​
Notice​
Currently, machine learning functions are in public beta.​
anomaly_compare​
The anomaly_compare function compares the degree of difference for a target observation object between two time periods.​
Function syntax​
  • Syntax format​
  • ​
    anomaly_compare(stamp, array[ feature_1, feature_2 ], array[ feature1_name, feature2_name ], timepoint, interval)​
    ​
  • Parameters description​
  • ​
    Parameters​
    Data type​
    Description​
    stamp​
    String​
    The column name of the time column. The format is Unixtime timestamp; measured in seconds.​
    array[features]​
    Array​
    Feature data of the observed object at a specific time.​
    array[featureNames]​
    Array​
    Description of the feature data.​
    timepoint​
    Bigint​
    The time when the observed object changes. The format is UnixTime timestamp.​
    interval​
    Bigint​
    The interval for collecting data. For example: if data is collected every 10 seconds, the interval is 10.​
    ​
  • Return values​
  • If the input value is NULL, the function returns NULL.​
Function examples​
  • Query statements​
  • ​
    *| SELECT anomaly_compare(stamp,array[ReqSize,RespSize],array['ReqSize','RespSize'],1702236290,1) FROM (SELECT stamp,ReqSize,RespSize FROM (SELECT CAST(stamp as BIGINT) AS stamp,ReqSize, RespSize order by stamp limit 1000))​
    ​
  • Query and analysis results​
  • ​​​
​
​
​
Last updated: 2026.05.08 10:10:41