云日志服务 LTS-字符串函数:split_to_map函数
split_to_map函数
使用指定的第一个分隔符拆分字符串,然后使用指定的第二个分隔符第二次拆分字符串。返回第二次拆分后的结果。
语法:split_to_map(str, splitStr1, splitStr2)
参数名称 |
描述 |
类型 |
是否必选 |
---|---|---|---|
str |
原始字符串。 |
String |
是 |
splitStr1 |
分隔符1。 |
String |
是 |
splitStr2 |
分隔符2。 |
String |
是 |
返回值类型:ARRAY类型
示例:SELECT SPLIT_TO_MAP('upstream_response_time:123, request_time:456', ',', ':')
类型 |
场景 |
---|---|
查询语句 |
SPLIT_TO_MAP('upstream_response_time:123, request_time:456', ',', ':') |
返回结果 |
{" request_time":"456","upstream_response_time":"123"} |