You need to enable JavaScript to run this app.
导航

CreateRule

最近更新时间2023.11.22 17:29:23

首次发布时间2022.05.11 11:26:48

调用 CreateRule 接口创建采集配置。

使用说明

创建采集配置之前,请确认已完成以下操作:

  • 已创建日志项目和日志主题。
  • 已创建机器组,并确认机器组的服务器心跳状态正常。
  • 已在数据源服务器上安装了最新版本的 LogCollector。

此接口的调用频率限制为 20 次/s,超出频率限制会报错 ExceedQPSLimit。

URI

请求方法
POST

URI

https://tls-{Region}.ivolces.com/CreateRule

传输协议

HTTPS

请求参数

参数
参数类型
是否必选
示例值
说明

TopicId

String

必选

4a9*********

采集配置所属的日志主题 ID。

RuleName

String

必选

testname

采集配置的名称。

  • 在一个日志主题中唯一。
  • 长度限制为 3~63 个字符,只能包含小写字母、中文、数字和连字符(-),必须以小写字母、中文、数字开头或结尾。

Paths

Array of String

可选

/

采集路径列表。

  • 最多能够创建 10 个采集路径。
  • 采集路径必须指定为绝对路径,暂不支持相对路径。
  • 当 InputType=0 或 InputType=2 时:
    采集路径支持完整匹配和通配符模式匹配,通配符只支持***?,但是最多只能配置 1 个**通配符。
  • 当 InputType=1 时:
    无需配置采集路径列表。

ExcludePaths

Array of ExcludePath

可选

/

采集黑名单列表。详细信息请参考 ExcludePath

  • 最多支持创建 10 个采集黑名单。
  • 当 InputType=0 或 InputType=2 时:
    • 当 Type 是 Path 时,Value 表示一个目录。支持完整匹配和通配符模式匹配,通配符只支持*?,不支持**通配符。
    • 当 Type 是 File 时,Value 表示一个文件名称。支持完整匹配和通配符模式匹配,通配符只支持***?,但是最多只能配置 1 个**通配符。
  • 当 InputType=1 时:
    不允许配置采集黑名单列表。

LogType

String

可选

delimiter_log

采集模式。

  • minimalist_log:(默认)单行全文模式。
  • json_log:JSON 模式。
  • delimiter_log:分隔符模式。
  • multiline_log:多行全文模式。
  • fullregex_log:完整正则模式。

ExtractRule

ExtractRule

可选

/

日志提取规则。详细信息请参考ExtractRule

说明

如果 LogType 指定为 minimalist_log 或 json_log 以外其他类型,此参数必选。

UserDefineRule

UserDefineRule

可选

/

用户自定义的采集规则。详细说明请参考 UserDefineRule

LogSample

String

可选

/

日志样例。

  • 日志样例的长度最大为 3000 个字符。
  • 日志样例的内容必须匹配采集模式。
    • 单行全文模式和 JSON 模式可以不填写日志样例。
    • 其他模式必须填写日志样例,并且日志样例的内容必须匹配采集模式。

InputType

Integer

可选

2

采集类型。

  • 0:(默认)宿主机日志文件
  • 1:K8s 容器标准输出。
  • 2:K8s 容器内日志文件。

ContainerRule

ContainerRule

可选

/

容器采集规则。详细说明请查看 ContainerRule

响应参数

参数
参数类型
示例值
说明

RuleId

String

fa************

采集配置的 ID。

示例

单行全文模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "minimalist_log",
    "ExtractRule": {
        "FilterKeyRegex": [
            {
                "Key": "__content__",
                "Regex": ".*ERROR.*"
            }
        ]
    },
    "LogSample": "2018-05-22 15:35:53.850 INFO XXXX",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

多行全文模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "multiline_log",
    "ExtractRule": {
        "BeginRegex": "\\[([^]]+)].*",
        "FilterKeyRegex": [
            {
                "Key": "__content__",
                "Regex": ".*ERROR.*"
            }
        ]
    },
    "LogSample": "[2018-10-01T10:30:01,000] [INFO] java.lang.Exception: exception happened\n    at TestPrintStackTrace.f(TestPrintStackTrace.java:3)\n    at TestPrintStackTrace.g(TestPrintStackTrace.java:7)\n    at TestPrintStackTrace.main(TestPrintStackTrace.java:16)",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

分隔符模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "delimiter_log",
    "ExtractRule": {
        "Delimiter": "&&",
        "Keys": [
            "time",
            "ip",
            "status",
            "",
            "user-agent"
        ],
        "TimeKey": "time",
        "TimeFormat": "%d/%b/%Y %H:%M:%S",
        "FilterKeyRegex": [
            {
                "Key": "status",
                "Regex": "200"
            }
        ],
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "05/May/2016 13:30:28&&10.200.36.139&&200&&18204&&sdk-go",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

JSON 模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "json_log",
    "ExtractRule": {
        "TimeKey": "time",
        "TimeFormat": "%d/%b/%Y %H:%M:%S",
        "FilterKeyRegex": [
            {
                "Key": "status",
                "Regex": "200"
            }
        ],
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "05/May/2016 13:30:28&&10.200.36.139&&200&&18204&&sdk-go",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

单行完整正则模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "fullregex_log",
    "ExtractRule": {
        "LogRegex": "([\\s\\S]+),\\s(\\S+),\\s(\\d+),\\s(\\d+),\\s(\\S+).*",
        "Keys": [
            "time",
            "ip",
            "status",
            "size",
            "user-agent"
        ],
        "TimeKey": "time",
        "TimeFormat": "%d/%b/%Y %H:%M:%S",
        "FilterKeyRegex": [
            {
                "Key": "status",
                "Regex": "200"
            }
        ],
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "05/May/2016 13:30:28, 10.200.36.139, 200, 18204, sdk-go",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

多行完整正则示例

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "fullregex_log",
    "ExtractRule": {
        "LogRegex": "\\[([^]]+)]\\s\\[(\\w+)]\\s([\\S\\s]+).*",
        "BeginRegex": "\\[([^]]+)].*",
        "Keys":[
            "time",
            "level",
            "message"
        ],
        "TimeKey": "time",
        "TimeFormat": "%Y-%b-dT%H:%M:%S,%f",
        "FilterKeyRegex": [
            {
                "Key": "level",
                "Regex": ".*ERROR.*"
            }
        ],
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "[2018-10-01T10:30:01,000] [INFO] java.lang.Exception: exception happened\n    at TestPrintStackTrace.f(TestPrintStackTrace.java:3)\n    at TestPrintStackTrace.g(TestPrintStackTrace.java:7)\n    at TestPrintStackTrace.main(TestPrintStackTrace.java:16)",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

Nginx 模式

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "fullregex_log",
    "ExtractRule": {
        "LogRegex": "(\\S*)\\s*-\\s*(\\S*)\\s*\\[(\\d+/\\S+/\\d+:\\d+:\\d+:\\d+)\\s+\\S+\\]\\s*\"(\\S+)\\s+(\\S+)\\s+(\\S+)\"\\s*(\\S*)\\s*(\\S*)\\s*(\\S*)\\s*(\\S*)\\s*\"([^\"]*)\"\\s*\"([^\"]*)\".*",
        "Keys": [
            "remote_addr",
            "remote_user",
            "time_local",
            "request_method",
            "request_uri",
            "protocol",
            "request_time",
            "request_length",
            "status",
            "body_bytes_sent",
            "http_referer",
            "http_user_agent"
        ],
        "TimeKey": "request_time",
        "TimeFormat": "%d/%b/%Y:%H:%M:%S",
        "FilterKeyRegex": [
            {
                "Key": "status",
                "Regex": "200"
            }
        ],
        "LogTemplate": {
            "Type": "Nginx",
            "Format": "format main  '$remote_addr - $remote_user [$time_local] \"$request\" $request_time $request_length $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\"';"
        },
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "192.168.1.1 - - [24/Sep/2022:12:23:12 +0800] \"POST /abc.com.testfile HTTP/1.0\" 0.000 129 200 43912736 \"-\" \"Wget/1.11.4 Red Hat modified\"",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

采集物理机日志

此处以采集模式为单行全文为例。

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "minimalist_log",
    "ExtractRule": {
        "FilterKeyRegex": [
            {
                "Key": "__content__",
                "Regex": ".*ERROR.*"
            }
        ]
    },
    "LogSample": "2018-05-22 15:35:53.850 INFO XXXX",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    }
}

容器标准输出

此处以采集模式为单行全文为例。

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "LogType": "minimalist_log",
    "ExtractRule": {
        "FilterKeyRegex": [
            {
                "Key": "__content__",
                "Regex": ".*ERROR.*"
            }
        ]
    },
    "LogSample": "2018-05-22 15:35:53.850 INFO XXXX",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    },
    "InputType": 1,
    "ContainerRule": {
        "Stream": "all",
        "ContainerNameRegex": ".*test.*",
        "IncludeContainerLabelRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "ExcludeContainerLabelRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "IncludeContainerEnvRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "ExcludeContainerEnvRegex": {
            "Key1": "Value1",
            "Key2": "Value2"
        },
        "EnvTag": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "KubernetesRule": {
            "NamespaceNameRegex": ".*test.*",
            "WorkloadType": "Deployment",
            "WorkloadNameRegex": ".*test.*",
            "IncludePodLabelRegex": {
                "Key1": "Value1",
                "Key2": "Value2"
            },
            "ExcludePodLabelRegex": {
                "Key1": "Value1",
                "Key2": "Value2"
            },
            "PodNameRegex": ".*test.*",
            "LabelTag": {
                "Key1": "Value1",
                "Key2": "Value2"
            }
        }
    }
}

容器文本日志

此处以采集模式为单行全文为例。

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "minimalist_log",
    "ExtractRule": {
        "FilterKeyRegex": [
            {
                "Key": "__content__",
                "Regex": ".*ERROR.*"
            }
        ]
    },
    "LogSample": "2018-05-22 15:35:53.850 INFO XXXX",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        }
    },
    "InputType": 2,
    "ContainerRule": {
        "ContainerNameRegex": ".*test.*",
        "IncludeContainerLabelRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "ExcludeContainerLabelRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "IncludeContainerEnvRegex": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "ExcludeContainerEnvRegex": {
            "Key1": "Value1",
            "Key2": "Value2"
        },
        "EnvTag": {
            "Key1": "Value1",
            "Key2": "Value2" 
        },
        "KubernetesRule": {
            "NamespaceNameRegex": ".*test.*",
            "WorkloadType": "Deployment",
            "WorkloadNameRegex": ".*test.*",
            "IncludePodLabelRegex": {
                "Key1": "Value1",
                "Key2": "Value2"
            },
            "ExcludePodLabelRegex": {
                "Key1": "Value1",
                "Key2": "Value2"
            },
            "PodNameRegex": ".*test.*",
            "LabelTag": {
                "Key1": "Value1",
                "Key2": "Value2"
            }
        }
    }
}

启用插件采集

此处以采集模式为单行全文为例。

POST https://tls-{Region}.ivolces.com/CreateRule HTTP/1.1
Content-Type: application/json
...
{
    "TopicId": "706f****-****-****-****-****46aa1f07",
    "RuleName": "testname",
    "Paths": [
        "/data/nginx/log/*/*/*.log"
    ],
    "ExcludePaths":[
        {
            "Type": "File",
            "Value": "/data/nginx/log/*/*/exclude.log"
        },
        {
            "Type": "Path",
            "Value": "/data/nginx/log/*/exclude/"
        }
    ],
    "LogType": "minimalist_log",
    "ExtractRule": {
        "TimeKey": "time",
        "TimeFormat": "%d/%b/%Y %H:%M:%S",
        "FilterKeyRegex": [
            {
                "Key": "status",
                "Regex": "200"
            }
        ],
        "UnMatchUpLoadSwitch": true,
        "UnMatchLogKey": "LogParseFailed"
    },
    "LogSample": "2018-05-22 15:35:53.850 INFO XXXX",
    "UserDefineRule": {
        "ParsePathRule": {
            "PathSample": "/data/nginx/log/dabaad5f-7a10/tls/app.log",
            "Regex": "\\/data\\/nginx\\/log\\/(\\w+)-(\\w+)\\/tls\\/app\\.log",
            "Keys": ["instance-id", "pod-name"]
        },
        "ShardHashKey": {
            "HashKey": "3C"
        },
        "EnableRawLog": true,
        "RawLogKey": "raw",
        "Fields": {
            "ClusterID":"dabaad5f-7a10-4771-b3ea-d821f73e****"
        },
        "Advanced": {
            "CloseInactive": 10
        },
        "Plugin": {
            "processors":[
                {
                    "json":{
                        "field":"__content__",
                        "trim_keys":{
                            "mode":"all",
                            "chars":"#"
                        },
                        "trim_values":{
                            "mode":"all",
                            "chars":"#"
                        },
                        "allow_overwrite_keys":true,
                        "allow_empty_values":true
                    }
                }
            ]
        }
    }
}

响应示例

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8 
...
{
    "RuleId":"faf*************"
}

错误码

错误码(Code)
HTTP 状态码
错误信息(Message)
说明

InvalidArgument

400

Invalid argument key %s, value %s, please check argument

参数不合法。

PathQuotaExceed

400

Path Quota Exceeded

超过采集路径限额。

ExcludePathQuotaExceed

400

Exclude Path Quota Exceeded

超过采集黑名单限额。

ExtractRuleKeyQuotaExceed

400

ExtractRule Key Quota Exceeded

超过提取规则的用户自定义的字段限额。

ExtractRuleFilterKeyRegexQuotaExceed

400

ExtractRule FilterKeyRegex Quota Exceeded

超过提取规则的过滤规则限额。

RuleAlreadyExist

409

Rule %s already exist

采集配置已存在。

InternalServerError

500

We encountered an unexpected server error, please try again later.

服务器内部错误。

更多信息,请参考通用错误码