---
title: "获取日志采集规则列表"
method: GET
path: "/log_collector/rules"
tags: ["LogCollectors"]
---

# 获取日志采集规则列表

`GET /log_collector/rules`

## Response `200`

OK

- PkgApiLogruleGetLogRuleResp[]
  - `created_at` UtilsJSONTime
    - `time.Time` string
  - `creator` string
  - `description` string
  - `entrypoint` PkgApiLogruleEntrypoint
    - `file_log_url` string
    - `std_log_url` string
  - `file_index_set_id` integer
  - `id` string
  - `message` string
  - `name` string
  - `new_rule_id` string — 当旧规则转换过新规则后，显示该字段
  - `old` boolean
  - `rule` BklogLogRule
    - `add_pod_label` boolean
    - `config` BklogLogRuleContainer
      - `conditions` BklogConditions
        - `match_content` string
        - `match_type` string — include, exclude(开发中，暂不支持)
        - `separator` string — 分隔符，| 等
        - `separator_filters` BklogSeparatorFilters[] — 分隔符过滤条件
          - `fieldindex` string — 第几列
          - `logic_op` string — and, or
          - `op` string — =
          - `word` string
        - `type` string — match, separator
      - `container` BklogContainer
        - `container_name` string
        - `workload_name` string
        - `workload_type` string
      - `data_encoding` string
      - `enable_stdout` boolean
      - `label_selector` BklogLabelSelector
        - `match_expressions` BklogExpression[]
          - `key` string
          - `operator` string
          - `value` string
        - `match_labels` BklogLabel[]
          - `key` string
          - `value` string
      - `namespaces` string[]
      - `paths` string[]
    - `extra_labels` BklogLabel[]
      - `key` string
      - `value` string
  - `rule_id` integer
  - `rule_name` string
  - `status` string
  - `std_index_set_id` integer
  - `updated_at` UtilsJSONTime
    - `time.Time` string
  - `updator` string

---

[API](https://skmtc.net/tencentblueking/apis/bcs-monitor-openapi.md) · [All operations](https://skmtc.net/tencentblueking/apis/bcs-monitor-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/bcs-monitor-openapi/revisions/ba6addc245e8/schema)
