在我的Grafana ElasticSearch数据源中,我有一个如下所示的属性:
=== object_attributes.variables ====
[
{ "key": "fruit", "value": "apple" },
{ "key": "fruit", "value": "banana" },
{ "key": "game", "value": "cricket" },
{ "key": "game", "value": "football" }
]
=== object_attributes.status =====
["failed","all","xxx"] or ["passed","all","xxx"]
因此,当我这样查询时
* AND object_attributes.status:"passed"
我得到预期结果* AND object_attributes.status:"passed" AND object_attributes.variable:{ "key": "fruit", "value": "banana" }
没有结果。
基本上,我想通过fruit: banana
和passed
过滤所有属性。那么,我如何修改第2点以获得结果?
1条答案
按热度按时间ipakzgxi1#
我自己想出来的。
我正在运行下面的查询,并能够获得预期的结果。
所以,我没有运行
object_attributes.variable:{ "key": "fruit", "value": "banana" }
,而是同时运行object_attributes.variable.key:"fruit" AND object_attributes.variable.value:"banana"
,它的工作就像一个魅力。