Querying Application Logs


When the log service is configured and running normally, you can query application logs by search conditions.

Querying Logs

Take the following steps to query the logs of the target application:

  1. From the left navigation bar, select Log Center > Log Search.

  2. Select the application name, the environment, and the cluster for the application.

  3. Select the start date and end date to query the logs.

  4. Enter the filtering conditions to query logs. ES searching syntax is supported.

  5. Click the Search button. To query the latest log information, select Auto refresh. The log information that matches the filtering conditions will be displayed.

    ../../../_images/querying_log.png
  6. Click View context after the log records to view the selected log and the logs before and after it.

Using Advanced Query

Use the advanced query function provided by Log Search to quickly assemble multiple query filters into query statements with ES-supported syntax, and execute the statements to satisfy log queries in complex business scenarios.

  1. Click Expand on the log query page to expand the Advanced Query input box.。

    ../../../_images/querying_log_advanced.png
  2. In the Advanced Query input box, enter the query statement. Click enter or enter some keywords, the system will pop up intelligent hints, you can select the corresponding hints by mouse or keyboard operation, and the selected keywords will be highlighted in the input box.

  3. To filter log information by Pod, select the Pod to which it applies from the Pod drop-down menu. the query filter criteria for that Pod will appear in the advanced query entry box. If a query statement has been entered previously, it will automatically be bracketed and joined by the AND keyword.

  4. To filter logs by log information level, select the log level from the Level drop-down menu and the corresponding query criteria will be generated in the advanced query input box. If you have already entered a query statement, it will automatically be joined with the AND keyword in parentheses over the query statement already entered.

    ../../../_images/querying_log_advanced_2.png
  5. Click the Search button to search the application log.

Logical Connectors

Advanced queries support concatenating multiple individual query statements via logical joiners and parentheses. Parentheses must be used to combine operators to produce correct Boolean logic, and spaces are required before and after the parentheses. The description of each logical joiner is as follows.

  • AND:The query results of the preceding and following statements are returned as the intersection

  • OR:The query results of the preceding and following statements are returned as a merged set

  • NOT:Identifies that subsequent statements are not allowed to be included in the result

  • ( ):Prioritize the logic inside the brackets


The order of priority of logical connectors is( ) > NOT > AND > OR。


More query syntax can be found in Elastic Search.