Skip to main content

Search Logs

Operation Scenarios

This document primarily guides you on how to perform log search in the cloud development console.

Operation Steps

  1. Log in to the CloudBase Console - Log Search.
  2. Go to the log search page and click 'Activate' to enable the log search feature.
  3. Select the time range for the search, then enter the search syntax in the input box (supports full-text search, fuzzy keyword search, and key-value search).

Log content is segmented into multiple phrases using delimiters. Users can input specific keywords to precisely retrieve relevant logs, and fuzzy keyword matching search is also supported. nBTyR0.png

Log content is returned in JSON object format, similar to key-value pairs in the form of key:value. Here, the key serves as a customizable attribute field for the log content object defined by the user, while the value represents the actual log content. The console also supports locating logs using the key:value format, with the value supporting fuzzy keyword search. Fuzzy keyword search operates as follows: nBTgMT.png

Log Service provides the capability for fuzzy search, allowing log retrieval using specific fuzzy keywords. The details are as follows:

MetacharacterDescription
*Fuzzy search keyword that matches zero, one, or multiple arbitrary characters. Starting with * is not supported. For example, entering abc* returns all matched logs starting with abc.
?Fuzzy search keyword that matches a single character at a specific position. For example, entering ab?c returns all matched logs starting with ab, ending with c, and having exactly one character in between.

nBTsGq.png nBT6zV.png

Query Syntax

The search supports the following query syntax:

SyntaxSemantics
key:valueKey-value search format where the value supports fuzzy search using ? and *
A and BThe logical "AND" operator returns the intersection of A and B. When multiple keywords are separated by spaces, the default operator is AND.
A or BThe logical "OR" operator returns the union of A and B.
not BThe logical "NOT" operator returns results that do not contain B.
A not BThe logical "minus" operator returns results that match A but not B, i.e., A - B.
A:BQuery format for key-value pairs. If the key or value contains special characters such as spaces or colons, they must be enclosed in quotes. For example, "error level":high
'a'The character 'a' is treated as a normal character and not processed as a syntax keyword.
"A"All keywords within A are treated as normal characters and are not processed as syntax keywords.
\ Escape character. The escaped character represents the symbol itself, for example, escaped quotation mark \", escaped colon \:, etc.
*Fuzzy search keyword that matches zero, one, or multiple arbitrary characters. Starting with * is not supported. For example: entering abc* returns all matched logs starting with abc.
?Fuzzy search keyword that matches a single character at a specific position. For example, entering ab?c returns all matched logs starting with ab, ending with c, and having exactly one character in between.

?

  • The precedence of operators from highest to lowest is : > " > and > not > or.
  • If b is text, the difference between a=b and a:b is that the former requires exact equality of a and b, while the latter means a contains b (processed according to tokenization logic and supports fuzzy search). Syntax keywords are case-insensitive.