> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scitix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Query and Analyze Logs

> Learn how to query logs by log type, time range, keywords, and filters, and troubleshoot issues using raw logs and log clustering.

On the Logs page, you can query logs by log type and locate target logs using a time range, keywords, and filter criteria. Query results support two views: **Raw Logs** and **Log Patterns**. The former displays individual log details, while the latter aggregates similar logs and identifies frequent error patterns.

To troubleshoot resources or workloads in a CKS cluster, go to the **OBSERVABILITY > Logs** page from the cluster workbench. The system presets the query scope based on the current cluster. You can further adjust the log type, time range, keywords, and filter criteria.

## Applicable Scenarios

Querying logs is suitable for the following scenarios:

* Troubleshoot abnormal resource, task, or application behavior.
* Search for application errors, task output, or debugging information by keyword.
* Filter logs by log fields.
* View aggregated results for similar logs through log clustering.
* Export query results for issue tracking or technical support troubleshooting.

## Query Logs

1. Log in to the [GPU Cloud console](https://console.scitix.ai/gpu-cloud/home) and go to the **Logs** page.

   To query from the cluster entry point, go to the **Clusters** page, click the name of the target cluster to open the cluster workbench, and then go to **OBSERVABILITY > Logs**.

2. Under **Kind**, select a log type, for example, `container_stdout`.

3. Select the time range to query.

4. Enter log keywords in the search box.

   The search box supports full-text matching of log content. If no keyword is specified, the system queries logs based on the current log type, time range, and filter criteria.

5. To further narrow the scope, click **Add Filter** and add field-based filter conditions.

   Filtering criteria and search criteria apply simultaneously to both the **Raw Logs** and **Log Patterns** views.

6. Click **Search**.

Log query results provide up to the first 5 pages. If there are many logs, narrow the time range or add keywords and filter criteria.

## View Raw Logs

On the **Raw Logs** tab, you can view log entries that match the current query criteria. When troubleshooting a specific issue, first use the time distribution to identify periods with concentrated anomalies, then use fields and log content to determine the scope of affected resources.

![Raw Logs](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/log/media/log-query-raw-logs.png?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=934edd679ea086bde1d98b488380ae6d)

When viewing raw logs, focus on the following information:

| Information | Description |
| - | - |
| Record count | The total number of log records matching the current query criteria. |
| Time distribution | The distribution of logs within the current time range. Drag the chart to select a time interval and narrow the query scope. |
| Field list | Adjust the fields displayed in the results table, view candidate field values, and add candidate values to the filter criteria. Available fields include `_timestamp`, `region`, `cluster`, `namespace_name`, `pod_name`, `container_name`, and `log`. |
| Log content | View specific log text and use resource fields to locate the corresponding cluster, namespace, Pod, container, or node. |

### Filter Logs by Field

* In **Available Fields** on the left, click the **+** next to a field to add it to **Selected Fields**. The Logs results table displays results based on the selected fields.

* Click a field name to view its candidate values. In the candidate value list, click the **+** next to the desired value to filter Logs by that value.

![Filter Logs by Field](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/log/media/log-query-field-values.jpg?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=a841e7bd9e70be856409d31df28bf2f8)

### Filter Logs by Time Range

Drag to select a time interval in the time distribution chart to quickly configure the time range. After selection, the time range at the top of the page is updated accordingly.

![Filter logs by time range](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/log/media/log-query-time-range.jpg?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=f6f76f29e20372148ba5fdf4444fd721)

## View Log Clusters

When there are many query results or you need to quickly identify frequent errors, switch to the **Log Patterns** tab to view aggregated results for similar logs.

Log clustering uses the current search criteria, filter criteria, and time range. You can first narrow the scope by using keywords and field filters, then switch to the **Log Patterns** tab to view the aggregation results.

![Log Patterns view](https://mintcdn.com/scitix-adfc65c2/zAestxkyOFggIEE8/gpu-cloud/log/media/log-query-log-patterns.png?fit=max\&auto=format\&n=zAestxkyOFggIEE8\&q=85\&s=54c0d91830031d900d09a384d8ce48bd)

On the **Log Patterns** tab, you can view the following information:

| Information | Description |
| - | - |
| **Count** | The number and percentage of logs matching the current clustering pattern. A higher count indicates that it should be prioritized to determine whether it is a common issue. |
| **Log Distribution** | The distribution of the current clustering pattern within the time range. This can be used to determine whether the issue persists or occurs in a concentrated burst. |
| **Log Pattern** | The aggregated log template. Placeholders such as `<IP>`, `<DATE>`, `<TIME>`, `<NUM>`, and `<URL>` represent normalized variable content. |
| **Cluster Field** | The field used to aggregate logs, typically `log`. |
| **Sample Size** | The number of log samples used to generate clustering results. With a larger sample size, the clustering results more closely reflect the overall distribution within the current query range. |

## Export Logs

To save or share the query results, click the download icon in the upper-right corner of the page to export the logs.

Before exporting, verify the time range, search keywords, and filter criteria to avoid exporting too many irrelevant logs.

## What should I do if I cannot find logs?

If the expected logs are not found, first check the following:

| Check Item | Description |
| - | - |
| Log type | Confirm that the correct **Kind** is selected, for example, `container_stdout`. |
| Time range | Confirm that the time range covers when the issue occurred. |
| Search keywords | Confirm that the keywords are not too restrictive. If necessary, clear the keywords and query again. |
| Filter criteria | Confirm that there are not too many filter criteria and that field values are entered correctly. |
| Resource name | When querying `container_stdout` logs, confirm that the cluster, namespace, pod, container, or workload name is correct. |
| Log output | When querying `container_stdout` logs, confirm that the target container outputs standard output logs. |

If you still cannot query the logs, record the query criteria, time range, resource name, and error message, and contact technical support.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.