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

Torch Log Service

Copy page
Download PDF
SQL syntax
SELECT syntax
Copy page
Download PDF
SELECT syntax
The SELECT syntax is used to select one or more key columns of data from a table. By default, the SELECT statement in TLS retrieves data that matches the query criteria from the current log topic. This article introduces the SELECT syntax format and examples.​
Grammar format​
SELECT statement format is as follows.​
​
* | SELECT Key​
​
​
Parameter​
Notice​
Key​
Log fields, expressions, SQL functions, asterisk (*), and more. Among them, when set to an asterisk (*), that is, *| SELECT *, all fields of the log are returned.​
​
Tip​
In SELECT analysis statements, you do not need to specify the from clause; by default, data from the current log topic is analyzed.​
To specify the source for analysis, set the from clause, for example:​
  • from "project_name"."topic_name": Specify the topic under the project as the analysis source.​
  • from "external_source_name": Designate an external data source as the source for analysis.​
Syntax example​
Example 1​
  • Scenarios​
  • Query all fields and field values in the log.​
  • Query and analysis statement​
  • ​
    * | SELECT *​
    ​
  • Query and analysis results​
  • ​​​
Example 2​
  • Scenarios​
  • Query the values of the `status` field and the `Method` field in the logs.​
  • Query and analysis statement​
  • ​
    * | SELECT status, Method​
    ​
  • Query and analysis results​
  • ​​​
Example 3​
  • Scenarios​
  • Count the number of logs.​
  • Query and analysis statement​
  • ​
    * | SELECT COUNT(*)​
    ​
  • Query and analysis results​
  • ​​​
​
Last updated: 2026.07.23 14:53:18