wget https://mirrors.tencent.com/install/cls/k8s/LogConfig.yaml
apiVersion: cls.cloud.tencent.com/v1kind: LogConfig ## 默认值metadata:name: test ## CRD资源名,在集群内唯一spec:clsDetail: ## 投递到CLS的配置...inputDetail: ## 日志源配置...
clsDetail:### 指定日志集和日志主题logsetName: test ## CLS 日志集的 name,非必填。若无该 logsetName 的日志集,会自动创建;若有,会在该日志集下创建日志主题topicName: test ## CLS 日志主题的 name,非必填。若在 logsetName 下没有该name的日志主题,会自动创建。## logsetName 和 topicName 指定之后,不指定 logsetId 和 topicId,会尝试自动创建日志主题;否则不会去创建 topic。logsetId: xxxxxx-xx-xx-xx-xxxxxxxx ## CLS 日志集的 ID,非必填,topicId: xxxxxx-xx-xx-xx-xxxxxxxx ## CLS 日志主题的 ID,非必填。如果不填 topicId,则必须填 logsetName 和 topicName,并且会尝试去自动创建 topic,并将创建后的 topic 的 topicId 填在该字段### 自动创建日志主题时,定义日志主题配置。 定义后不可修改,修改不生效period: 30 ## 非必填,生命周期,单位天,可取值范围1~3600,低频存储取值范围7~3600天;取值为3640时代表永久保存storageType: hot ## 非必填,日志主题的存储类型,可选值 hot(标准存储),cold(低频存储);默认为 hot。hotPeriod: 7 ## 非必填,沉降周期,单位天。可取值范围7~3600。仅在 storageType:hot 时生效,hotPeriod 需要大于 period,沉降的周期为 Period-hotPeriodpartitionCount: 1 ## 非必填,日志主题分区个数。默认创建1个,最大支持创建10个分区。autoSplit: "true" ## 非必填,是否开启自动分裂,默认值为 true。值必须以双引号""包裹maxSplitPartitions: 50 ## 非必填,开启自动分裂后的最大分裂数量。默认值为50tags: ## 非必填,标签描述列表,通过指定该参数可以同时绑定标签到相应的日志主题。最大支持9个标签键值对,同一个资源只能绑定到同一个标签键下。- key: xxx ## 标签 keyvalue: xxx ## 标签 value### 定义采集规则logType: json_log ## 日志解析格式,json_log 代表 json 格式,delimiter_log 代表分隔符格式,minimalist_log 代表单行全文格式,multiline_log 代表多行全文格式,fullregex_log 代表单行完全正则格式,multiline_fullregex_log 代表多行完全正则格式,user_define_log 代表组合解析。默认为 minimalist_logexcludePaths: ## 非必填,采集黑名单路径列表。仅在 inputDetail 为 containerFile 或 hostFile 时生效- type: File ## 类型,选填 File 或 Pathvalue: /xx/xx/xx/xx.log ## type 对应的值userDefineRule: xxxxxx ## 非必填,用户自定义采集规则,Json 格式序列化的字符串### 提取、过滤规则extractRule: ## 非必填,提取、过滤规则。如果设置了 ExtractRule,则必须设置 LogType,详情参考 extractRule 对象说明timeKey: xxx ## 时间字段的 key 名字,time_key 和 time_format 必须成对出现timeFormat: xxx ## 时间字段的格式,参考 c 语言的 strftime 函数对于时间的格式说明输出参数delimiter: xxx ## 分隔符类型日志的分隔符,只有 log_type 为 delimiter_log 时有效logRegex: xxx ## 整条日志匹配规则,只有 log_type 为 fullregex_log 时有效beginningRegex: xxx ## 行首正则匹配规则,只有 log_type 为 multiline_log 或 fullregex_log 时有效keys: ## 取的每个字段的 key 名字,为空的 key 代表丢弃这个字段,只有 log_type 为 delimiter_log 时有- a- bfilterKeys: ## 与 filterRegex 要对应,filterKeys 是数组,表示需要过滤的日志的 key- a- bfilterRegex: ## 与 filterKeys 要对应,filterRegex 是正则字符串数组,key 对应的过滤规则 regex。- aRegx- bRegxadvancedFilters: ## 高级过滤规则,该字段仅适用于v1.1.15及以上的采集组件版本,低于v1.1.15请使用 filterKeys 与 filterRegex- key: level ## 需要过滤的 Keyrule: 0 ## 过滤规则,支持的数值枚举为:0(等于),1(字段存在),2(字段不存在), 3(不等于)。value: info ## 需要过滤的值 value。其中当 rule 为1或2时,value 无需指定。unMatchUpload: "false" ## 解析失败日志是否上传,true 表示上传,false 表示不上传。默认不上传unMatchedKey: "parseFailed" ## 解析失败的日志上传 CLS 的 key 名称backtracking: "-1" ## “-1”或者“0”,-1表示全量采集,0表示增量采集,其他大于0的数字表示增量采集模式下的回溯数据量。默认全量。isGBK: "true" ## "true"或者"false",默认"false"非 jbkjsonStandard: "true" ## "true"或者"false",默认"true"标准 json### 高级采集配置advancedConfig: ## 非必填ClsAgentMaxDepth: 1 ## 采集器采集最大目录深度,大于等于0的整数,0表示当前目录。ClsAgentFileTimeout: 60 ## 文件超时属性,即超过该指定时间的日志文件没有被修改,则采集器不在监控。 该参数需要大于等于0的整数,单位秒。0为不超时,全部采集。ClsAgentParseFailMerge: true ## 合并解析失败日志,取值范围: true 或 false### 创建 topic 时可自定义全文索引### 仅在自动创建日志主题时支持定义, 不支持修改已存在日志主题的索引fullTextIndex: ## 非必填,全文索引设置status: "on" ## 全文索引开关,如果不设置,则会默认打开全文索引;如果设置 on 打开,不设置其他参数,则 caseSensitive 和 tokenizer 都会是默认值;如果设置 off 关闭,则不打开全文索引tokenizer: "@&()='\\",;:<>[]{}/ \\n\\t\\r" ## 全文索引的分词符,如果全文索引开关打开,则必须设置 tokenizer。可以设置为"@&()='\\",;:<>[]{}/ \\n\\t\\r",为默认设置caseSensitive: false ## 是否大小写敏感containZH: false ## 是否包含中文### 创建 topic 时可自定义TAG和键值索引设置indexStatus: "on" ## 非必填,TAG 索引和键值索引设置开关,如果不设置,则默认创建pod_name/namespace/container_name三个TAG索引;off则表示不设置键值索引autoIndex: "off" ## 非必填, off 则表示不设置自动配置索引,on 标识开启自动配置索引indexs: ## 非必填。- indexName: xxx ## 需要配置键值索引或者 TAG 索引的字段;Pod 相关的 namespace/pod_name/pod_ip/pod_uid/container_id/container_name/image_name/cluster_id 八个元数据字段和 pod_label_前缀字段会设置为 TAG 索引,其他字段会设置为键值索引。indexType: "text" ## 非必填。字段类型,目前支持的类型有:long、text、double。非必填tokenizer: "@&()='\\",;:<>[]{}/ \\n\\t\\r" ## 非必填。字段的分词符,其中的每个字符代表一个分词符;仅支持英文符号及\\n\\t\\r;long 及 double 类型字段需为空;## text 类型字段推荐使用 @&?|#()='",;:<>[]{}/ \\n\\t\\r\\ 作为分词符;sqlFlag: true ## 非必填。字段是否开启分析功能。true/false 字段是否开启分析功能,如果是日志主题是低频日志主题,sqlFlag 选项不能被打开。containZH: false ## 非必填。是否包含中文。
Tue Jan 22 12:08:15 CST 2019 Installed: libjpeg-turbo-static-1.2.90-6.el7.x86_64
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# 单行日志logType: minimalist_log
__CONTENT__:Tue Jan 22 12:08:15 CST 2019 Installed: libjpeg-turbo-static-1.2.90-6.el7.x86_64
2019-12-15 17:13:06,043 [main] ERROR com.test.logging.FooFactory:java.lang.NullPointerExceptionat com.test.logging.FooFactory.createFoo(FooFactory.java:15)at com.test.logging.FooFactoryTest.test(FooFactoryTest.java:11)
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# 多行日志logType: multiline_logextractRule:# 只有以日期时间开头的行才被认为是新一条日志的开头,否则就添加换行符\\n并追加到当前日志的尾部beginningRegex: \\d{4}-\\d{2}-\\d{2}\\s\\d{2}:\\d{2}:\\d{2},\\d{3}\\s.+
__CONTENT__:2019-12-15 17:13:06,043 [main] ERROR com.test.logging.FooFactory:\\njava.lang.NullPointerException\\n at com.test.logging.FooFactory.createFoo(FooFactory.java:15)\\n at com.test.logging.FooFactoryTest.test(FooFactoryTest.java:11)
10.135.46.111 - - [22/Jan/2019:19:19:30 +0800] "GET /my/course/1 HTTP/1.1" 127.0.0.1 200 782 9703 "http://127.0.0.1/course/explore?filter%5Btype%5D=all&filter%5Bprice%5D=all&filter%5BcurrentLevelId%5D=all&orderBy=studentNum" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0" 0.354 0.354
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# 完全正则格式logType: fullregex_logextractRule:# 正则表达式,会根据()捕获组提取对应的valuelogRegex: (\\S+)[^\\[]+(\\[[^:]+:\\d+:\\d+:\\d+\\s\\S+)\\s"(\\w+)\\s(\\S+)\\s([^"]+)"\\s(\\S+)\\s(\\d+)\\s(\\d+)\\s(\\d+)\\s"([^"]+)"\\s"([^"]+)"\\s+(\\S+)\\s(\\S+).*beginningRegex: (\\S+)[^\\[]+(\\[[^:]+:\\d+:\\d+:\\d+\\s\\S+)\\s"(\\w+)\\s(\\S+)\\s([^"]+)"\\s(\\S+)\\s(\\d+)\\s(\\d+)\\s(\\d+)\\s"([^"]+)"\\s"([^"]+)"\\s+(\\S+)\\s(\\S+).*# 提取的key列表,与提取的value的一一对应keys: ['remote_addr','time_local','request_method','request_url','http_protocol','http_host','status','request_length','body_bytes_sent','http_referer','http_user_agent','request_time','upstream_response_time']
body_bytes_sent: 9703http_host: 127.0.0.1http_protocol: HTTP/1.1http_referer: http://127.0.0.1/course/explore?filter%5Btype%5D=all&filter%5Bprice%5D=all&filter%5BcurrentLevelId%5D=all&orderBy=studentNumhttp_user_agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0remote_addr: 10.135.46.111request_length: 782request_method: GETrequest_time: 0.354request_url: /my/course/1status: 200time_local: [22/Jan/2019:19:19:30 +0800]upstream_response_time: 0.354
[2018-10-01T10:30:01,000] [INFO] java.lang.Exception: exception happenedat TestPrintStackTrace.f(TestPrintStackTrace.java:3)at TestPrintStackTrace.g(TestPrintStackTrace.java:7)at TestPrintStackTrace.main(TestPrintStackTrace.java:16)
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx#多行-完全正则格式logType: multiline_fullregex_logextractRule:#行首完全正则表达式,只有以日期时间开头的行才被认为是新一条日志的开头,否则就添加换行符\\n并追加到当前日志的尾部beginningRegex: \\[\\d+-\\d+-\\w+:\\d+:\\d+,\\d+\\]\\s\\[\\w+\\]\\s.*#正则表达式,会根据()捕获组提取对应的valuelogRegex: \\[(\\d+-\\d+-\\w+:\\d+:\\d+,\\d+)\\]\\s\\[(\\w+)\\]\\s(.*)# 提取的 key 列表,与提取的 value 的一一对应keys: ['time','level','msg']
time: 2018-10-01T10:30:01,000`level: INFO`msg:java.lang.Exception: exception happenedat TestPrintStackTrace.f(TestPrintStackTrace.java:3)at TestPrintStackTrace.g(TestPrintStackTrace.java:7)at TestPrintStackTrace.main(TestPrintStackTrace.java:16)
{"remote_ip":"10.135.46.111","time_local":"22/Jan/2019:19:19:34 +0800","body_sent":23,"responsetime":0.232,"upstreamtime":"0.232","upstreamhost":"unix:/tmp/php-cgi.sock","http_host":"127.0.0.1","method":"POST","url":"/event/dispatch","request":"POST /event/dispatch HTTP/1.1","xff":"-","referer":"http://127.0.0.1/my/course/4","agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0","response_code":"200"}
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# JSON格式日志logType: json_log
agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0body_sent: 23http_host: 127.0.0.1method: POSTreferer: http://127.0.0.1/my/course/4remote_ip: 10.135.46.111request: POST /event/dispatch HTTP/1.1response_code: 200responsetime: 0.232time_local: 22/Jan/2019:19:19:34 +0800upstreamhost: unix:/tmp/php-cgi.sockupstreamtime: 0.232url: /event/dispatchxff: -
10.20.20.10 ::: [Tue Jan 22 14:49:45 CST 2019 +0800] ::: GET /online/sample HTTP/1.1 ::: 127.0.0.1 ::: 200 ::: 647 ::: 35 ::: http://127.0.0.1/
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# 分隔符日志logType: delimiter_logextractRule:# 分隔符delimiter: ':::'# 提取的key列表,与被分割的字段一一对应keys: ['IP','time','request','host','status','length','bytes','referer']
IP: 10.20.20.10bytes: 35host: 127.0.0.1length: 647referer: http://127.0.0.1/request: GET /online/sample HTTP/1.1status: 200
1571394459,http://127.0.0.1/my/course/4|10.135.46.111|200,status:DEAD,
{"processors": [{"type": "processor_split_delimiter","detail": {"Delimiter": ",","ExtractKeys": [ "time", "msg1","msg2"]},"processors": [{"type": "processor_timeformat","detail": {"KeepSource": true,"TimeFormat": "%s","SourceKey": "time"}},{"type": "processor_split_delimiter","detail": {"KeepSource": false,"Delimiter": "|","SourceKey": "msg1","ExtractKeys": [ "submsg1","submsg2","submsg3"]},"processors": []},{"type": "processor_split_key_value","detail": {"KeepSource": false,"Delimiter": ":","SourceKey": "msg2"}}]}]}
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:clsDetail:topicId: xxxxxx-xx-xx-xx-xxxxxxxx# 分隔符日志logType: user_define_loguserDefineRule:"{ \\"processors\\": [ { \\"type\\": \\"processor_split_delimiter\\", \\"detail\\": { \\"Delimiter\\": \\",\\", \\"ExtractKeys\\": [ \\"time\\", \\"msg1\\",\\"msg2\\"] }, \\"processors\\": [ { \\"type\\": \\"processor_timeformat\\", \\"detail\\": { \\"KeepSource\\": true, \\"TimeFormat\\": \\"%s\\", \\"SourceKey\\": \\"time\\" } }, { \\"type\\": \\"processor_split_delimiter\\", \\"detail\\": { \\"KeepSource\\": false, \\"Delimiter\\": \\"|\\", \\"SourceKey\\": \\"msg1\\", \\"ExtractKeys\\": [ \\"submsg1\\",\\"submsg2\\",\\"submsg3\\"] }, \\"processors\\": [] }, { \\"type\\": \\"processor_split_key_value\\", \\"detail\\": { \\"KeepSource\\": false, \\"Delimiter\\": \\":\\", \\"SourceKey\\": \\"msg2\\" } } ] } ] }"
time: 1571394459submsg1: http://127.0.0.1/my/course/4submsg2: 10.135.46.111submsg3: 200status: DEAD
inputDetail:type: container_stdout ## 指定采集日志的类型,包括 container_stdout(容器标准输出)、container_file(容器文件)、host_file(主机文件)containerStdout: ## 容器标准输出配置,仅在 type:container_stdout 时生效namespace: default ## 采集容器的 kubernetes 命名空间。支持多个命名空间,如果有多个命名空间使用","分隔,如:default,namespace。如果不指定,代表所有命名空间。注意:与 excludeNamespace 不能同时指定excludeNamespace: nm1,nm2 ## 排除采集容器的 kubernetes 命名空间。支持多个命名空间,如果有多个命名空间使用","分隔,如:nm1,nm2。如果不指定,代表所有命名空间。注意:与 namespace 不能同时指定nsLabelSelector: environment in (production),tier in (frontend) ## 根据命名空间 label 筛选符合的 namespaceallContainers: false ## 是否采集指定命名空间中的所有容器的标准输出。注意:allContainers=true 时不能同时指定 workload、includeLabels 和 excludeLabelscontainerOperator: in ## container 选择方式,包含填in,排除填notincontainer: xxx ## 指定采集或不采集日志的容器名,支持填写多个,逗号隔开。若 containerOperator 为 in,则可填*,代表采集所有容器includeLabels: ## 采集包含指定 label 的 Pod,与 workload 不能同时指定key: value1 ## 支持匹配同一个 key 下多个 value 值的 pod,例填写 environment = production,qa 表示当 key 为 environment,value 值为 production 或 qa 时,均会被匹配,注意输入多个 value 值时请使用逗号隔开。如果同时指定了 excludeLabels,则匹配与 excludeLabels 交集的 podexcludeLabels: ## 采集不包含包含指定 label 的 Pod,与 workload、namespace 和 excludeNamespace 不能同时指定key2: value2 ## 支持匹配同一个 key 下多个 value 值的 pod,例填写 environment = production,qa 表示当 key 为 environment,value 值为 production 或 qa 时,均会被排除,注意输入多个 value 值时请使用逗号隔开。如果同时指定了 includeLabels,则匹配与 includeLabels 交集的 podmetadataLabels: ## 指定具体哪些 pod label 被当做元数据采集,如果不指定,则采集所有 pod label 为元数据- label1metadataContainer: ## 指定具体哪些容器环境相关元数据被采集,如果不指定,则采集所有容器环境相关元数据(namespace,pod_name,pod_ip,pod_uid,container_id,container_name,image_name)- namespacecustomLabels: ## 用户自定义 metadatalabel: l1workloads: ## 采集指定命名空间 -> 指定工作负载类型中 -> 指定工作负载 -> 指定容器中的日志- container: xxx ## 要采集的容器名,如果不指定,代表 workload Pod 中的所有容器containerOperator: in ## container 选择方式,包含填 in,排除填 notinkind: deployment ## workload 类型,支持 deployment、daemonset、statefulset、job、cronjobname: sample-app ## workload 的名字namespace: prod ## workload 的命名空间containerFile: ## 容器内文件配置,仅在 type:container_file 时生效namespace: default ## 采集容器的 kubernetes 命名空间,必须指定一个命名空间excludeNamespace: nm1,nm2 ## 排除采集容器的 kubernetes 命名空间。支持多个命名空间,如果有多个命名空间使用","分隔,如:nm1,nm2。 如果不指定,代表所有命名空间。 注意:与 namespace 不能同时指定nsLabelSelector: environment in (production),tier in (frontend) ## 根据命名空间 label 筛选符合的 namespacecontainerOperator: in ## container 选择方式,包含填 in,排除填 notincontainer: xxx ## 指定采集或不采集日志的容器名,支持填写多个,逗号隔开。 若 containerOperator 为 in,则可填*,代表采集所有容器。若制定了 workload 类型和名称,此处可定义指定工作负载中容器的名称logPath: /var/logs ## 日志文件夹,支持通配符 * 和 ?;* 表示匹配多个任意字符,? 表示匹配单个任意字符filePattern: app_*.log ## 日志文件名,支持通配符 * 和 ? ,* 表示匹配多个任意字符,? 表示匹配单个任意字符## 指定容器内多个日志路径和文件,该参数和 logPath、filePattern 不兼容,只能指定 filePaths 或者(logPath、filePattern)## 如果从(logPath 和 filePattern) -> filePaths 会触发日志重采;相反从 filePaths->logPath 和 filePattern)也一样filePaths:- file: /var/logs ## 日志文件夹,支持通配符 * 和 ?;* 表示匹配多个任意字符,? 表示匹配单个任意字符path: app_*.log ## 日志文件名,支持通配符 * 和 ? ;* 表示匹配多个任意字符,? 表示匹配单个任意字符- file: /var/logs1path: app_*.logincludeLabels: ## 采集包含指定 label 的 Pod,与 workload 不能同时指定key: value1 ## 收集规则收集的日志会带上 metadata,并上报到消费端。支持匹配同一个 key 下多个 value 值的 pod,例填写 environment = production,qa 表示当 key 为 environment,value 值为 production 或 qa 时,均会被匹配,注意输入多个 value 值时请使用逗号隔开。如果同时指定了 excludeLabels,则匹配与 excludeLabels 交集的 podexcludeLabels: ## 采集不包含包含指定 label 的 Pod,与 workload 不能同时指定key2: value2 ## 支持匹配同一个 key 下多个 value 值的 pod,例填写 environment = production,qa 表示当 key 为 environment,value 值为 production 或 qa 时,均会被排除,注意输入多个 value 值时请使用逗号隔开。如果同时指定了 includeLabels,则匹配与 includeLabels 交集的 podmetadataLabels: ## 指定具体哪些 pod label 被当做元数据采集,如果不指定,则采集所有 pod label 为元数据- namespacemetadataContainer: ## 指定具体哪些容器环境相关元数据被采集,如果不指定,则采集所有容器环境相关元数据(namespace,pod_name,pod_ip,pod_uid,container_id,container_name,image_name)customLabels: ## 用户自定义 metadatakey: valueworkload: ## 采集指定命名空间 -> 指定工作负载类型中 -> 指定工作负载中的所有容器。若要指定工作负载中的容器,需在外层 container 中指定kind: deployment ## workload 类型,支持 deployment、daemonset、statefulset、job、cronjobname: sample-app ## workload 的名字namespace: prod ## workload 的命名空间hostFile: ## 节点文件路径,仅在 type:host_file 时生效filePattern: '*.log' ## 日志文件名,支持通配符 * 和 ? ,* 表示匹配多个任意字符,? 表示匹配单个任意字符logPath: /tmp/logs ## 日志文件夹,支持通配符 * 和 ? ;* 表示匹配多个任意字符,? 表示匹配单个任意字符## 指定容器内多个日志路径和文件,该参数和 logPath、filePattern 不兼容,只能指定 filePaths 或者(logPath、filePattern)## 如果从(logPath 和 filePattern) -> filePaths 会触发日志重采;相反从 filePaths->logPath 和 filePattern)也一样filePaths:- file: /var/logs ## 日志文件夹,支持通配符 * 和 ?;* 表示匹配多个任意字符,? 表示匹配单个任意字符path: app_*.log ## 日志文件名,支持通配符 * 和 ? ;* 表示匹配多个任意字符,? 表示匹配单个任意字符- file: /var/logs1path: app_*.logcustomLabels: ## 用户自定义 metadatalabel1: v1
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:inputDetail:type: container_stdoutcontainerStdout:namespace: defaultallContainers: true...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigspec:inputDetail:type: container_stdoutcontainerStdout:allContainers: falseworkloads:- namespace: productionname: ingress-gatewaykind: deployment...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigspec:inputDetail:type: container_stdoutcontainerStdout:namespace: productionallContainers: falseincludeLabels:k8s-app: nginx...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigspec:inputDetail:type: container_stdoutcontainerStdout:allContainers: falsecontainerOperator: incontainer: ingressworkloads:- namespace: productionname: ingress-gatewaykind: deployment...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:inputDetail:type: container_filecontainerFile:namespace: productionworkload:name: ingress-gatewaykind: deploymentcontainer: nginxfilePaths:- file: access.logpath: /data/nginx/log...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigspec:inputDetail:type: container_filecontainerFile:namespace: productionincludeLabels:k8s-app: ingress-gatewaycontainer: nginxfilePaths:- file: access.logpath: /data/nginx/log...
apiVersion: cls.cloud.tencent.com/v1kind: LogConfigmetadata:name: test ## 采集配置名称spec:inputDetail:type: host_filehostFile:logPath: /datafilePattern: *.log...
kubectl create -f /usr/local/LogConfig.yaml
kubectl get logconfig
文档反馈