- Documentation
Torch Log Service
FAQs
Query and analysis FAQ
How to accurately query phrases?
Query and analysis FAQ
How to accurately query phrases?
How to accurately query phrases?
During log retrieval, you can use phrase queries or LIKE syntax when you need to accurately match a phrase.
The log service uses word segmentation when retrieving data, and the results of the exact query are not completely accurate. For example, when the successful request is executed, the log service will retrieve according to the successful and request statement, and the logs containing successful and request will be matched instead of the exact matching phrase successful request . If you need an exact match for the phrase successful request , use the phrase query or LIKE syntax.
phrase query
Based on SQL LIKE syntax
The target phrase can be precisely matched by phrase query.
Example: Query logs containing the phrase successful request .
The SQL LIKE syntax is used to specify search conditions in the WHERE clause, which can achieve accurate query of logs. In LIKE syntax, the percent sign (%) matches any number of characters, including 0; the underscore (_) matches a single character.
Example: The query tag field value contains logs for successful requests .
explain
When using SQL LIKE syntax, the target field (such as tag ) must have key-value indexing enabled and statistics enabled. For specific operation, please see Configure indexes.
Last updated: 2026.06.25 17:01:03