【发布时间】:2019-02-25 14:29:56
【问题描述】:
我正在尝试找到正确的语法/查询,以根据与“源”字段匹配的模式(如见于 graylog webui)。
我已经尝试了很多组合,但都不起作用:
root@log [~]: curl -XDELETE 'http://localhost:9200/graylog_71/message/_query' -d'{"query" : {"term": { "source" : "exact_server_name_here"}}}'
{"found":false,"_index":"graylog_71","_type":"message","_id":"_query","_version":2,"_shards":{"total":1,"successful":1,"failed":0}}
再试一次:
root@log [~]: curl -XDELETE 'http://localhost:9200/graylog_71/message/_query' -d '
{
"query": {
"query_string" : {
"query" : "exact_server_name_here"
}
}
}
'
我还检查了这个 SO 帖子,它有效,但不符合我的需求: Delete a specific log message from Graylog
回答 val 评论:是的,删除插件已安装(我在最初的帖子中忘了提及这一点)
忍受我是 ES 新手 :)
谢谢
[编辑#1] 根据 Val 要求:
root@log [~]: curl 'localhost:9200/_cat/plugins?v'
name component version type url
【问题讨论】:
-
你可能没有删除查询插件。见这里:stackoverflow.com/questions/40395463/…
-
@Val 已安装,我更新了我的问题,谢谢
-
根据你得到的回复,它正在尝试删除一个id为
_id的文档...你能运行这个curl 'localhost:9200/_cat/plugins?v'吗? -
你是否为 elasticsearch 安装了
delete_by_query插件? -
@AHT :是的,我这样做了安装了删除插件 :)