gpt4 book ai didi

rest - 预期 [START_OBJECT] 在 [filter] 下

转载 作者:行者123 更新时间:2023-12-02 22:46:03 26 4
gpt4 key购买 nike

我想在 aggs 中放置双重过滤器。像这样。

"aggs": {
"download1" : {
"filter" : [
{ "term": { "IPV4_DST_ADDR":"192.168.0.159"}},
{ "range": { "LAST_SWITCHED": { "gte": "now-5m" } }}
],
"aggs" : {
"downlod_bytes" : { "sum" : { "field" : "IN_BYTES" } }
}
}
}

但它显示错误:

"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "Expected [START_OBJECT] under [filter], but got a [START_ARRAY] in [download1]",
"line": 33,
"col": 24
}
]}

我该怎么办,先谢谢了!

最佳答案

您需要将这两个查询与 bool/filter

结合起来
{
"aggs": {
"download1": {
"filter": {
"bool": {
"filter": [
{
"term": {
"IPV4_DST_ADDR": "192.168.0.159"
}
},
{
"range": {
"LAST_SWITCHED": {
"gte": "now-5m"
}
}
}
]
}
},
"aggs": {
"downlod_bytes": {
"sum": {
"field": "IN_BYTES"
}
}
}
}
}
}

关于rest - 预期 [START_OBJECT] 在 [filter] 下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48039718/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com