Hi
Trying to clear all data belonging to a particular beat host. Started with the following query: curl -XGET 'localhost:9200/filebeat-2017.05.10/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"filtered":{"query":{"query_string":{"query":"(beat.hostname:$BEAT_HOSTNAME)"}}}}}', which returns the desired results. I was hoping after installing delete-by-query, and replacing GET with DELETE the removal should take place. However, I get the following: No handler found for uri [/filebeat-2017.05.10/_search?pretty] and method [DELETE]
(Probably, I am doing this wrong.) Any ideas as how to remove beat data for a given host?
Cheers,
Hi
Thank you for your reply. "_query" does not seem to be a valid option in 2.4.1:
GET:
curl -XGET 'localhost:9200/filebeat-2017.05.10/_query?pretty' -d '{"query":{"filtered":{"query":{"query_string":{"query":"($BEAT_HOSTNAME)"}}}}}'
{
"error" : {
"root_cause" : [ {
"type" : "illegal_argument_exception",
"reason" : "No feature for name [_query]"
} ],
"type" : "illegal_argument_exception",
"reason" : "No feature for name [_query]"
},
"status" : 400
}
DELETE:
curl -XDELETE 'localhost:9200/filebeat-2017.05.10/_query?pretty' -d '{"query":{"filtered":{"query":{"query_string":{"query":"($BEAT_HOSTNAME)"}}}}}'
No handler found for uri [/filebeat-2017.05.10/_query?pretty] and method [DELETE]
Thank you for your reply. I am wondering if you have the opportunity to try the above on a filebeat server. I have tried 2 variations:
1- curl -XDELETE 'localhost:9200/filebeat-/_query' -H 'Content-Type: application/json' -d '{"query":{"filtered":{"query":{"query_string":{"query":"SomeHostName"}}}}}'
No handler found for uri [/filebeat-/_query] and method [DELETE]
2- curl -XDELETE 'localhost:9200/filebeat-/_query' -H 'Content-Type: application/json' -d '{"query":{"filtered":{"query":{"query_string":{"query":"(beat.hostname:vanlabvpa18.cisco.com)"}}}}}'
No handler found for uri [/filebeat-/_query] and method [DELETE]
Both seem to indicate that there is no delete and query handler on filebeat entries.
Note that I can completely wipe out filebeat indices with: curl -XDELETE 'localhost:9200/filebeat-*?pretty'
And as noted above, I can GET and query filebeat entries; however, combining the 2 doesn't seem to be possible.
( Kopf seems to be deprecated in favour of cerebro. Will look into it.)
Cheers,
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.