CLS offers real-time log query to help identify business problems quickly. You need to configure and enable index before log search.
Log search is performed based on the keywords of a log that are matched with the information you entered. You can flexibly adjust the keywords by customizing a word delimiter or specifying whether to enable case sensitivity depending on your business needs. The following example uses a log to explain the word delimiters and case-sensitivity.
10002345987;write;ERROR;code=400;topic does not exist;
The text of the raw log can be split into several keywords by using a word delimiter to facilitate your search. For example:
;=, the log is split into 6 words:
topic does not exist. In exact search, you can find the log by typing any of the above words.
Case-sensitivity refers to the precise distinction between uppercase and lowercase letters in a string. For example, when the word delimiter is
error. This is because
ERRORare regarded as two different keywords.
Index is an optional feature for log topics. You need to select the log topic to query, and then enable its index feature. Specific steps are as follows:
After a log topic is created, its index is not enabled by default. You need to manually enable it.
CLS uses a complete log as text for searching. When the full-text index is enabled, you can use a keyword to search for the log. You can also set a custom full-text word delimiter. The text of the raw log is split into several keywords by using a word delimiter to facilitate your search.
To illustrate the full-text word delimiter feature, here are some examples for search.
|Full-Text Word Delimiter||Exact Search||Fuzzy Search|
|Left blank||Enter "10002345987;write;error;code=400;topic does not exist;"||Enter "10002345987*"|
|;||Enter "code=400" or "topic does not exist"||Enter "code=40?" or "code*"|
|;=||Enter "code", "400", or "code=400"||Enter "topic*" or "40?"|
|; =||Enter "topic", "does", "not", or "exist"||Enter "do*"|
CLS can configure key-value index according to the key in the collection configuration. In the key-value index configuration, enter the appropriate key according to the index requirements, and specify its data type (text, long, or double). Custom word delimiters are supported by in the "text" data type. Different word delimiters can be set for different keys.
CLS supports the following three field types:
|long||Integer (Int 64)|
|double||Floating-point number (64 bit)|