Skip to content

Search


The Explorer search bar supports text search, field filter, JSON search, and function query. You can also switch to DQL mode to write complete query statements.

Select Search Method

Query Requirement Usage Method Example
Search text content Text Search connection timeout
Search consecutive phrases Phrase Search "connection timeout"
Filter by field and value Field Filter service:api
Search embedded JSON fields JSON Search @meta.service:api
Search MD5-masked data MD5 Function Query See below
Search IP CIDR ranges CIDR Function Query CIDR(@client_ip, 10.0.0.0/8)
Execute complex queries or calculations DQL Query L::logs:(*) {...}
Search and Filter

When you directly input text, the system performs a text search; when you use field_name:field_value, the system performs a field filter. For example, error timeout is used to search for text, while service:api is used to filter the service field.

Text Search

The Explorer text search uses the search() query syntax. The system tokenizes the input and retrieves data that contains all tokens simultaneously.

  • Chinese characters are tokenized by character;
  • English is tokenized by word boundaries such as spaces and punctuation;
  • English search is case-insensitive;
  • Tokens do not need to appear consecutively.

Token Search

After entering text, the system automatically tokenizes it. As long as the data contains all tokens simultaneously, even if there are other contents between tokens, it can be retrieved.

Chinese Example:

Input: 我喜欢苹果

Possible matches:
- 我喜欢苹果
- 我很喜欢吃苹果
- 苹果是我喜欢的水果

All results above contain all valid tokens of the search content, and these tokens do not need to appear consecutively.

English Example:

Input: connection timeout

Possible matches:
- connection timeout
- Connection retry timeout
- connection request failed due to timeout

All results above contain both "connection" and "timeout", tokens do not need to appear consecutively and are case-insensitive.

Phrase Search

If you need to search for complete and consecutive phrases, use English double quotation marks " to enclose the search content:

  • "我喜欢苹果": matches "我喜欢苹果,也喜欢香蕉", but does not match "我很喜欢吃苹果";
  • "connection timeout": matches "connection timeout occurred", but does not match "connection retry timeout".
Stop Words

Some words that appear frequently and have little significance for retrieval will not be included in the full-text index. If the search results are inconsistent with expectations, refer to the Full-Text Index Stop Words List.

JSON Search

Prerequisites
  • The workspace was created after June 23, 2022;
  • Used in the Log Explorer.

JSON search is used to query embedded fields in the message of logs, and message must be a valid JSON format. The query format is @field_name:field_value; when querying nested fields, use . to connect field names at each level.

For example, the message content is as follows:

{
  "__namespace": "tracing",
  "cluster_name_k8s": "k8s-demo",
  "meta": {
    "service": "ruoyi-mysql-k8s",
    "name": "mysql.query"
  }
}

The following conditions can be used for querying:

@cluster_name_k8s:k8s-demo       # Exact match
@cluster_name_k8s:k?s*           # Wildcard match
@meta.service:ruoyi-mysql-k8s    # Query nested fields
@meta.service:ruoyi?mysql*       # Wildcard match for nested fields

Here, * matches zero or more characters, and ? matches one character. The wildcards here are only used for field filtering and are not applicable to normal text search.

Field Name Contains .

In JSON search, . defaults to representing nested field levels. If the field name itself contains ., use a backslash \ to escape it.

Scenario Correct Syntax Description
Query nested field log.tag @log.tag:error . represents field level
Query field name user.id @user\.id:1001 \ escapes . as part of the field name

It is not supported to use double quotation marks to enclose field names, for example, @"user.id":1001.

MD5 Function Query

If the sensitive data scanning rule uses MD5 encryption, the original value will be replaced with an irreversible 32-character hexadecimal string. When you need to locate masked data using the original value, you can use the MD5 function query in the Explorer.

Query format:

field_name:md5|original_value

For example, the original value red in the color field has been MD5 encrypted, you can enter:

color:md5|red

The system will calculate the MD5 value of red and match it with the hash value saved in the color field. MD5 is case-sensitive and space-sensitive, so ensure the input content is exactly the same as the original value before encryption.

MD5 encryption is irreversible, and the original content cannot be restored from the hash value. For more information, refer to Sensitive Data Scanning.

DQL Query

When you need to use functions, expressions, aggregations, or complex filter conditions, you can click the DQL button on the right side of the search bar to enter DQL Query mode:

The system will automatically bring in the corresponding data type and data source based on the current Explorer. For example, the following DQL query is used to retrieve logs from the last hour where message contains connection timeout:

L("default")::logs:(message) {search(message, "connection timeout")} [1h]
  • L represents log data;
  • "default" represents the log index;
  • logs represents the data source;
  • [1h] represents querying data from the last hour.

After entering DQL mode, you need to use a complete DQL statement. Different Explorers correspond to different data types, and you cannot switch to other data types within the current Explorer.

CIDR Function Query

The CIDR function is used to query data in a specified IP field that belongs to a certain CIDR range, performing range matching rather than string matching.

CIDR consists of a network address and a prefix length, for example, 13.0.0.0/8. The larger the prefix length, the smaller the address range matched; /32 in IPv4 matches only one IP address.

Query format:

CIDR(@field_name, IP_CIDR)

For example, to query data in the network.client.ip field that belongs to the 13.0.0.0/8 CIDR range:

CIDR(@network.client.ip, 13.0.0.0/8)
Matches:
- 13.0.0.1
- 13.100.20.5
- 13.255.255.255

Does not match:
- 12.255.255.255
- 14.0.0.1

If you need to exactly match a single IPv4 address, use /32:

CIDR(@network.client.ip, 13.10.20.30/32)

If the field value is empty, malformed, or not a valid IP address, it will not be matched.

In DQL mode, you can use the lowercase cidr() function and enclose the CIDR range in double quotes:

L::nginx:(*) {cidr(client_ip, "13.0.0.0/8")} [1h]

Search History

The current user can view recently used search and filter conditions in the local browser, up to 100 records. Click a historical condition to reuse it in the current Explorer.

Search History Merge Records

The Explorer is a common tool within the platform and is applicable to multiple features. There are some differences in the interoperability of search history across different features:

  • The search history of the six Explorers in RUM (Session, View, Resource, Action, Long Task, Error) is shared;
  • The search history of the Container Explorer and the Kubernetes Explorer is shared;
  • The search history of the Resource Catalog Explorer is shared;
  • The search history of the Log Explorer and the Log Error Tracking Explorer is shared;
  • The search history of the Tracing Explorer, APM Error Tracking, and Profiling Explorer is shared.

Except for the above cases, other Explorers save their own search history independently.

More Reading