# Query the ULSConfig of UK8S - ListUK8SULSConfig

## Overview

Query the ULSConfig of UK8S






## Definition

### Public Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Action**     | string  | Corresponding API command name, the current API is `ListUK8SULSConfig`.                      | **Yes** |
| **PublicKey**  | string  | The user's public key can be obtained from [Console](https://console.dezai.com/uaccount/api_manage)                                             | **Yes** |
| **Signature**  | string  | User signature generated based on public key and API command, see [Signature Algorithm](/docs/api/summary/signature.md)  | **Yes** |

### Request Parameters

| Parameter Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Region** | string | Region. See [Region and Zone List](/docs/api/summary/regionlist) |**Yes**|
| **Zone** | string | Zone. See [Region and Zone List](/docs/api/summary/regionlist) |**Yes**|
| **ProjectId** | string | Project ID. Leave it blank for the default project. Sub-accounts must fill in. Please refer to the [GetProjectList API](/docs/api/summary/get_project_list) |No|
| **TopicID** | string | The target Topic ID in ULS for receiving logs. |**Yes**|
| **ClusterId** | string | The UK8S cluster ID. |No|

### Response Field

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **RetCode** | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. |**Yes**|
| **Action** | string | Operation command name. |**Yes**|
| **Message** | string | Returns an error message, providing detailed description when `RetCode` is non-zero. |No|
| **LogConfig** | array[[*ULSLogConfig*](#ulslogconfig)] | Log Config |**Yes**|

#### Data Model


#### ULSLogConfig

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ClusterId** | string | The UK8S cluster ID. |**Yes**|
| **MachineGroup** | string | The machine group. |**Yes**|
| **ExtractRule** | [*ULSExtractRule*](#ulsextractrule) | Defines the rules for log extraction, parsing, and formatting. See ULSExtractRule. |No|
| **InputDetail** | [*ULSInputDetail*](#ulsinputdetail) | Defines the log input source, such as container files. See ULSInputDetail. |No|
| **MatchRule** | [*ULSMatchRule*](#ulsmatchrule) | Defines the target Pods or workloads to be matched by this collection rule. See ULSMatchRule. |No|
| **TopicID** | string | The target Topic ID in ULS for receiving logs. |No|
| **Name** | string | The name of the log collection rule. |No|

#### ULSExtractRule

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **CollectPolicy** | string | Collection policy. Valid values: full for full collection of existing logs and increment for incremental collection from the current time. Default: full. |No|
| **Encode** | string | Encoding format of the raw log. Valid values: utf-8 and gbk. Default: utf-8. |No|
| **LogType** | string | Log parsing type. Valid values: json, delimiter, full_regex, multi_line_full_regex, multi_line_delimiter, minimal_list, and multi_line. |No|
| **Delimiter** | string | Delimiter used for delimiter or multi_line_delimiter. Valid values: space, tab, \|, ;, and ,. |No|
| **DelimiterBase64** | string | Base64-encoded delimiter. When specified, it takes precedence over Delimiter. |No|
| **BeginningRegex** | string | Beginning-of-line regular expression. For multi_line, multi_line_full_regex, or multi_line_delimiter, either BeginningRegex or BeginningRegexBase64 must be specified. |No|
| **BeginningRegexBase64** | string | Base64-encoded beginning-of-line regular expression. When specified, it takes precedence over BeginningRegex. |No|
| **LogRegex** | string | Log extraction regular expression. For full_regex or multi_line_full_regex, either LogRegex or LogRegexBase64 must be specified. |No|
| **LogRegexBase64** | string | Base64-encoded log extraction regular expression. When specified, it takes precedence over LogRegex. |No|
| **TimeKey** | string | Name of the field containing the log timestamp. |No|
| **TimeFormat** | string | Time format corresponding to TimeKey. For json, full_regex, or multi_line_full_regex, TimeFormat is required when TimeKey is specified. |No|
| **UnMatchUpload** | string | Whether to upload logs that fail parsing. The string true uploads them, while false discards them. Default: false. |No|
| **UnMatchKey** | string | Key used to store raw logs that cannot be parsed. This field is required when UnMatchUpload is true. |No|
| **Keys** | array[string] | List of extracted field names. This field is supported only for delimiter, full_regex, multi_line_full_regex, and multi_line_delimiter. |No|

#### ULSInputDetail

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **FilePaths** | array[[*ULSFilePaths*](#ulsfilepaths)] | List of log collection paths. This field applies only to container_file. |No|
| **Type** | string | Log input type. Valid values: container_file and container_stdout. |No|
| **Stream** | string | Container output stream type. This field applies only to container_stdout. Valid values: all, stdout, and stderr. Default: all. |No|
| **InputMetadata** | [*ULSInputMetadata*](#ulsinputmetadata) | Defines the container-related metadata to attach to logs. |No|

#### ULSMatchRule

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **ContainerOperator** | string | Container name matching operator. Valid values: in (include) and notin (exclude). |**Yes**|
| **Container** | string | Names of the containers to match, separated by commas. Use * to match all containers. |**Yes**|
| **Workloads** | array[[*ULSWorkloadMatch*](#ulsworkloadmatch)] | Matches logs by workload. |No|
| **PodLabels** | [*ULSPodLabelsMatch*](#ulspodlabelsmatch) | Matches Pods by labels for more flexible selection. |No|

#### ULSWorkloadMatch

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Namespace** | string | Namespace containing the workload. |No|
| **Type** | string | Workload type, such as deployment, statefulset, daemonset, cronjob, or job. |No|
| **Name** | string | Name of the workload. |No|

#### ULSPodLabelsMatch

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **NamespaceOperator** | string | Namespace name matching operator. Valid values: in and notin. |No|
| **Namespace** | string | Namespace to match. This field is required when NamespaceOperator is specified. |No|
| **Labels** | array[[*ULSLabels*](#ulslabels)] | An array of label selectors that defines the label matching conditions. |No|

#### ULSLabels

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Key** | string | Key of the label to match. |No|
| **ValueOperator** | string | Label value matching operator. Valid values: in and notin. |No|
| **Value** | string | Value of the label to match. |No|

#### ULSFilePaths

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Path** | string | Defines the log collection path. |No|
| **File** | string | Specifies the file to collect. |No|

#### ULSInputMetadata

| Field Name | Type | Description Information | Required |
|:---|:---|:---|:---|
| **Container** | string | Specifies the container metadata fields to collect. If left empty, no container metadata is collected. Valid fields: container_name, namespace, pod_name, pod_ip, pod_uid, container_id, and image_name. Configure Pod label metadata through InputDetail.Metadata.Labels. |No|
| **Labels** | string | Defines which Pod labels to collect. Use * to collect all labels, app,version to collect only the app and version labels, or an empty string to collect no labels. |No|

## Example

### Request Example
    
```
https://apiucloud.dezai.com/?Action=ListUK8SULSConfig
&Region=cn-zj
&Zone=cn-zj-01
&ProjectId=FUgCRzMm
&TopicId=NCbAXMbi
&ClusterId=nkxapMln
```

### Response Example
    
```json
{
  "Action": "ListUK8SULSConfigResponse",
  "ClusterId": "rAtMbQFa",
  "ExtractRule": {},
  "InputDetail": {},
  "MatchRule": {},
  "Name": "FvhXSZnH",
  "RetCode": 0,
  "TopicId": "xZhaZWGY"
}
```





