我不小心从 Logstash 将一些数据加载到 Elasticsearch 中。
基本上,我忘记包含start_position => "beginning"
在 Logstash 配置中,所以如果我删除.sincedb_*
并重新运行,我会有一小部分重复的数据。
我使用 Kibana 来查看这些数据并单击“检查”按钮来查看它已运行的查询:
curl -XGET 'http://els-server:9200/logstash-2014.02.19,logstash-2014.02.18/_search?pretty' -d '{
"facets": {
"0": {
"date_histogram": {
"field": "@timestamp",
"interval": "10m"
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"query_string": {
"query": "tags:\"a-tag-that-uniquely-matches-the-mistake\""
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"range": {
"@timestamp": {
"from": 1392723206360,
"to": "now"
}
}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}'
如果我在 ELS 服务器上运行它,它会找到相同的结果集(如预期的那样):
{
"took" : 23,
"timed_out" : false,
"_shards" : {
"total" : 10,
"successful" : 10,
"failed" : 0
},
"hits" : {
"total" : 558829,
"max_score" : 0.0,
"hits" : [ ]
},
"facets" : {
"0" : {
"_type" : "date_histogram",
"entries" : [ {
"time" : 1392799200000,
"count" : 91
} ]
}
}
}
该行"count" : 91
匹配 Kibana 中显示的相同数量的事件。
如何将其转换为 DELETE 操作以删除这 91 个条目?
谢谢,
知识库