Accessing the Log Search Page

After configuring log structuring parsing and indexing, you can enter statements to search for log records that contain specific keywords. You can also search for log data by time range to locate events and issues that occur in a specified period.

Search statements are used to define the filter criteria for log query and obtain the logs that meet the criteria. A search statement may be a keyword, a value, a value range, a space, an asterisk (*), or the like. If it is a space or asterisk (*), no filtering criteria is specified. For more information, see Using LTS Search Syntax.

Searching Logs

  1. Log in to the management console and choose Management & Deployment > Log Tank Service. The Log Management page is displayed by default.

  2. Click the target log group or stream. The log stream details page is displayed.

  3. You can select a time range above the search box to view log data accordingly.

    There are three types of time range: relative time from now, relative time from last, and specified time. Select a time range as required.

    Note

    • From now: queries log data generated in a time range that ends with the current time, such as the previous 1, 5, or 15 minutes. For example, if the current time is 19:20:31 and 1 hour is selected as the relative time from now, the charts on the dashboard display the log data that is generated from 18:20:31 to 19:20:31.

    • From last: queries log data generated in a time range that ends with the current time, such as the previous 1 or 15 minutes. For example, if the current time is 19:20:31 and 1 hour is selected as the relative time from last, the charts on the dashboard display the log data that is generated from 18:00:00 to 19:00:00.

    • Specified: queries log data that is generated in a specified time range.

  4. Enter search criteria in the search box based on Using LTS Search Syntax to view, search for, and filter log data.

    • In the search area, click the search box, enter a keyword or select a field or keyword from the drop-down list, and click Search.

      Note

      • The structured fields are displayed in key:value format.

    • In the search area, press the up and down arrows on the keyboard to select a keyword or search syntax from the drop-down list, press Tab or Enter to select a keyword or syntax, and click Search.

    • Click a field for which quick analysis has been enabled to add it to the search box. For details about how to enable quick analysis, see Creating an LTS Quick Analysis Task.

      Note

      If the field you click already exists in the search box, it will be replaced by this newly added one. If the field is added for the first time, fields in the search box are searched using the AND operator.

  5. On the Raw Logs tab page, perform the following operations. For more operations, see Common Log Search Operations.

    1. Under Log Statistics, view the bar chart showing the log quantity in different time segments. The scale of the log quantity is displayed on the left.

    2. In the log content area, hover the cursor over a field and click the log content in blue. You can search for logs by copying, adding to query, and excluding from query.

    3. In the log list, click image1 in front of the time to display structured fields in table or JSON format.

      • On the Table tab page, you can search for logs by adding a field to or excluding a field from a query, or by setting whether a field exists, whether a field does not exist, or whether a field is hidden. For details, see Using LTS Search Syntax.

      • On the JSON tab page, you can view and copy a log.

  6. Set the layout of log data, including whether to display fields or display fields in a simple view.

    1. Select Edit layouts from the drop-down list to access the layout setting page. The list also contains options such as the default layout, pure layout, and default container log layout, for you to set whether to display fields.

      • Cloud: This mode is applicable to users who have the write permission. Layout information is stored on the cloud.

      • Local Cache: This mode is applicable to users who have only the read permission. Layout information is cached in the local browser.

    2. Click image2 to add a custom layout and set the layout name and visibility of layout fields.

    3. After the setting is complete, click OK. The new custom layout is displayed in the drop-down list.

Common Log Search Operations

In the log content display area, you can share and download logs, and view context. For details, see Table 1.

Table 1 Common operations

Operation

Description

Interactive search

Click image3 in front of the search box. In the displayed Interactive Search dialog box, select fields for index configuration, set the filtering mode, and add associations and groups. After the setting is complete, you can preview the search syntax.

Creating quick search

Click image4 to create a quick search.

Sharing logs

Click image5 to copy the link of the current log search page to share the logs that you have searched.

Refreshing logs

You can click image6 to refresh logs in two modes: manual refresh and automatic refresh.

  • Manual refresh: Select Refresh Now from the drop-down list.

  • Automatic refresh: Select an interval from the drop-down list to automatically refresh logs. The interval can be 15 seconds, 30 seconds, 1 minute, or 5 minutes.

Copying logs

Click image7 to copy the log content.

Viewing context of a log

Click image8 to view the log context.

Note

You can select Simple View to view the log context. You can also download the context.

Simplifying field details

Click image9 to view the simplified field details.

Unfold/Fold

Click image10 to display all the log content. Click image11 to fold the log content.

Note

Unfold is enabled by default.

Downloading logs

Click image12. On the displayed Download Logs page, click Direct Download or Transfer and Download.

  • Direct Download: Download log files to the local PC. Up to 5,000 logs can be downloaded at a time.

    Select .csv or .txt from the drop-down list and click Download to export logs to the local PC.

    Note

    • If you select Export .csv, logs are exported as a table.

    • If you select Export .txt, logs are exported as a .txt file.

  • Transfer and Download: Transfer log files to OBS first and download them from OBS. Click Transfer to access the Configure Log Transfer page. For details, see Transferring Logs to OBS.

Collapse all/Expand all

Click image13 to set the number of lines displayed in the log content. Click image14 to close it.

Note

By default, logs are not collapsed, and two rows of logs are shown after collapsing. You can display up to six rows.

JSON

Move the cursor over image15, click JSON, and set JSON formatting.

Note

Formatting is enabled by default. The default number of expanded levels is 2.

  • Formatting enabled: Set the default number of expanded levels. Maximum value: 10.

  • Formatting disabled: JSON logs will not be formatted for display.

Collapse configuration

Move the cursor over image16, click Log Collapse, and set the maximum characters to display in a log.

If the number of characters in a log exceeds the maximum, the extra characters will be hidden. Click Expand to view all.

Note

Logs are collapsed by default, with a default character limit of 400.

Log time display

Move the cursor over image17 and click Log time display. On the page that is displayed, set whether to display milliseconds and whether to display the time zone.

Note

By default, the function of displaying milliseconds is enabled.

Virtual Scrolling

Move the cursor over image18 and click Virtual Scrolling. On the page that is displayed, set whether to enable virtual scrolling and enter the buffer size.

Note

  • Virtual scrolling eliminates or minimizes frame and page freezing for better user experience.

  • Data is re-rendered during the process. This may affect smoothness.

  • The buffer size determines the amount of data that can be loaded simultaneously. The larger the buffer, the more data loaded simultaneously, but the worse the scrolling performance.

Invisible fields (image19)

This list displays the invisible fields configured in the layout settings.

  • The image20 button is unavailable for log streams without layout settings configured.

  • If the log content is CONFIG_FILE and layout settings are not configured, the default invisible fields include appName, clusterId, clusterName, containerName, hostIPv6, NameSpace, podName, and serviceID.