接口说明
调用modifyRule接口编辑采集配置
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
POST /paasopenapi/api/cmplogadmin/cmplog/collect/rule/modify HTTP/1.1
请求参数
名称 |
类型 | 位置 | 是否必选 | 示例 | 描述 |
---|---|---|---|---|---|
ruleId | Long | body | 是 | 1001 | 采集规则ID |
unitId | Long | body | 否 | 722 | 日志单元ID |
name | String | body | 否 | 采集规则名称 | |
logPathJson | String | body | 是 | 采集路径 | |
extractMode | Byte | body | 否 | 提取模式,1-文本日志 2- CCSE标准输出 3-CCSE应用日志 | |
firstLinePattern | String | body | 否 | 1 | 首行正则表达式 |
delimeterVo | DelimeterVo | body | 否 | 分隔符分词,具体结构见下表 | |
RegexVo | RegexVo | body | 否 | 正则分词,具体结构见下表 | |
extractPattern | String | body | 否 | 1 | 提取正则表达式 |
RegexVo数据结构
eg | String | "2023-08-17-16:58:03:582 INFO InitializingExecutorService 'applicationTaskExecutor" | 日志样例数据 |
---|---|---|---|
firstLinePattern | String | "\s+" | 首行正则表达式 |
regexStr | String | "\s+" | 日志数据提取的正则表达式 |
logContent | List | "logContent":[ { "key":"time", "content":"2023-08-17-16:58:03:582", "type":"string" } ] | 日志提取内容;TypeContent数据结构如下:key:自定义的分词keycontent: 分词key对应的日志样例数据type : 分词key所对应的日志数据类型,可传string, double int bool |
DelimeterVo数据结构
eg | String | "2023-08-17-16:58:03:582 INFO InitializingExecutorService 'applicationTaskExecutor" | 日志样例数据 |
---|---|---|---|
delimeter | String | " | " |
logContent | List | "logContent":[ { "key":"time", "content":"2023-08-17-16:58:03:582", "type":"string" } ] | 日志提取内容;TypeContent数据结构如下:key:自定义的分词keycontent: 分词key对应的日志样例数据type : 分词key所对应的日志数据类型,可传string, double int bool |
返回数据
名称 | 类型 | 示例 | 描述 |
---|---|---|---|
code | Integer | 0 | 返回状态码 |
data | Integer | 1 |
示例
请求示例
POST/paasopenapi/api/cmplogadmin/cmplog/collect/rule/modifyHTTP/1.1
'Content-Type:application/json'
Body:{"name":"input-rule","collectPolicy":"add","logPathJson":"[{\"path\":\"/app/ctgrabbitmq/7f05ecbf75f2482b925f05dc64d0cc47/ctg_pulsar_mgr_instance/906125/RabbitMQ-oavah0/*/logs/console.log\"}]","logPathBlacklistStatus":0,"extractMode":1,"cuttingMode":4,"unitId":1012,"ruleId":7211,"resPoolCode":"6019b5007a0b11eab5db0242ac110002"}
正常返回示例
JSON格式
HTTP/1.1200OK
{
"code":0,
"msg":"string",
"data":0
}
错误码
HTTP状态码(Status Code) | 错误码(Error Code) | 描述(Description) |
---|---|---|
400 | MissingParameter | 缺少必要的请求参数。 |
400 | InvalidParameterValue | 请求参数取值错误。 |
500 | FailedOperation | 操作失败 |