es中text字段中内容为json格式,如何解析json内容做聚合操作
场景:
字段
"line" : {
"type" : "text",
"analyzer" : "standard"
},
line:内容是json格式。
例如:
请问:
怎么对json内容中的数据解析,聚合,sum,avg等
比如 输出:dataNum,sum(dataNum) 等
有没有解决思路?
请教
场景:
字段
"line" : {
"type" : "text",
"analyzer" : "standard"
},
line:内容是json格式。
例如:
{
"RECORDS":[
{
"id":1,
"name":"水电费1",
"type":1,
"status":1,
"outIntype":"1123",
"dataNum":12,
"createTime":"2020/10/26 13:48:21",
"note":"safd手动蝶阀1"
},
{
"id":2,
"name":"史蒂夫2",
"type":2,
"status":2,
"outIntype":"2史蒂夫",
"dataNum":21,
"createTime":"2020/10/26 13:48:56",
"note":"史蒂夫合同号2"
},
{
"id":3,
"name":"不方便3",
"type":3,
"status":1,
"outIntype":"3符",
"dataNum":222,
"createTime":"2020/10/26 13:49:15",
"note":"功能干活呢3"
}
]
}
请问:
怎么对json内容中的数据解析,聚合,sum,avg等
比如 输出:dataNum,sum(dataNum) 等
有没有解决思路?
请教
2 个回复
guoyanbiao520
赞同来自:
liuxg - Elastic
赞同来自: