日志服务
参数 | 类型 | 是否必选 | 示例值 | 描述 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
TopicId | String | 是 | 4a********* | 日志主题 ID。 |
FullText | 否 | / | 全文索引配置。
| |
KeyValue | 否 | / | 键值索引配置。
| |
UserInnerKeyValue | 否 | / | 预留字段索引配置。
| |
MaxTextLen | Integer | 否 | 2048 | 统计字段值的最大长度,默认为 2048,取值范围为 64~1048576,单位为字节。 说明
|
EnableAutoIndex | Boolean | 否 | true | 是否开启索引自动更新,开启后系统将根据新出现的字段自动添加到键值索引。
|
EnablePhraseIndex | Boolean | 否 | false | 是否开启短语查询索引版功能,开启后使用双引号即可用于精准匹配指定的短语,进行短语查询。
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
Delimiter | String | 是 | , ;/\n\t | 全文索引的分词符。
|
CaseSensitive | Boolean | 是 | false | 是否大小写敏感。
|
IncludeChinese | Boolean | 否 | false | 检索时,是否对日志的中文内容按照中文语法进行分词,默认为 false。
|
参数 | 类型 | 是否必选 | 示例值 | 描述 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
Key | String | 是 | "Key": "test-key1" | 需要配置键值索引的字段名称,最多添加 100 个字段。
说明 对于 JSON 类型键值索引的子字段,需要通过.表示 JSON 字段之间的层级关系,例如 JSON 字段 namelist 中包含 text 类型的子字段 totalcount 和 JSON 类型的 info,info 中又包含字段 name,各个字段名称应分别配置为totalcount 和 info.name。 |
Value | 是 | "Value": { "ValueType": "text", "Delimiter": "", "CaseSensitive": true, "IncludeChinese": false, "SqlFlag": false } | 需要配置键值索引的字段信息。 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
参数 | 类型 | 是否必选 | 示例值 | 描述 |
SqlFlag | Boolean | 否 | false | 字段是否开启分析功能。默认为 false。 开启统计分析功能后,支持配置分词符和包含中文。 |
IndexAll | Boolean | 否 | false | 是否为 JSON 字段中所有值为文本的字段创建索引。 |
JsonKeys | 否 | [ { "Key":"key1", "Value":{ "ValueType":"text", "SqlFlag":true } }, { "Key":"key2", "Value":{ "ValueType":"long", "SqlFlag":true } }, { "Key":"key3.key4.key5", "Value":{ "ValueType":"double", "SqlFlag":true } } ] | 当 ValueType 为 json 时,可通过 JsonKeys 字段配置 JSON 子字段键值索引,其值为 KeyValueInfo 数组。
| |
Delimiter | String | 否 | , ;/\n\t | 字段的分词符。默认为空("")。
|
ValueType | String | 是 | text | 字段类型。
|
CaseSensitive | Boolean | 否 | true | 是否区分大小写。默认为 false。 |
IncludeChinese | Boolean | 否 | false | 检索时,是否对日志的中文内容按照中文语法进行分词。
|
Description | String | 否 | test | 索引字段的描述信息。 |
IndexSQLAll | Boolean | 否 | false | 是否为 JSON 字段开启自动索引和统计功能。
|
AutoIndexFlag | Boolean | 否 | false | 该索引是否是自动索引添加。
|
HTTP 状态码 | 错误码 | 错误信息 | 说明 |
HTTP 状态码 | 错误码 | 错误信息 | 说明 |
400 | InvalidArgument | Invalid argument key %s, value %s, please check argument. | 参数不合法。 |
400 | InvalidArgument | At least one of full-text indexing and key-value indexing must be turned on. | 全文索引与键值索引至少要开启一项。 |
400 | InvalidArgument | Index key value_type:%s conflict with [includeChinese:%t, casSensitive:%t, delimiter:%s], please check argument. | long/double 类型不支持配置包含中文、大小写敏感和分词符。 |
400 | InvalidIndexJsonKeys | Non-JSON field %s configures JsonKeys, please check argument. | 非 JSON 字段配置子字段。 |
400 | ConflictIndexJsonKeys | JsonKeys %s and %s have conflict prefix, please check argument. | JsonKeys 键名存在前缀冲突。 |
400 | InvalidArgument | Index key sqlFlag:%t conflict with [includeChinese:%t, delimiter:%s], please check argument. | 开启统计后,不支持配置包含中文和分词符。 |
400 | IndexKeyValueQuotaExceed | Exceeded index key-value quota. | 超过键值索引限额。 |
400 | IndexKeyDuplicate | The %dth index key name:%s is duplicate, please check argument. | 索引的键值名称重复。 |
400 | InvalidArgument | Index key delimiter:%s conflict with includeChinese:%t, please check argument. | 分词符和中分分词不能同时配置。 |
400 | IndexKVNULL | Index key value index is open, but the key value list is null, please check argument. | 键值索引配置的键值个数为 0。 |
404 | TopicNotExist | Topic does not exist. | 日志主题不存在。 |
409 | IndexAlreadyExist | Index already exist | 索引已存在。 |
500 | InternalServerError | We encountered an unexpected server error, please try again later. | 服务器内部错误。 |
400 | IndexInnerKeyUnSupport | key-value indexing for inner key: %v, doesn't support | 不支持为 %v 字段设置预留字段索引。 |
400 | IndexInnerKeyConflict | full-text indexing and content indexing can't be set together | 全文索引与__content__索引配置冲突。 |