Hello Guys,
I have the last ELK version, and I installed the plugin delete-by-query and my forwarder is Logstash.
I had read the documentation 2.3 in ELK site.
First
TO check if my struct is the same as example Twitter, I found one server by ID:
curl -XGET 'http://localhost:9200/logstash-2016.02.23/Nxlogs/AVMPTRrp28MHpUptVm7C?pretty'
This respond (short version):
{
"_index" : "logstash-2016.02.23",
"_type" : "Nxlogs",
"_id" : "AVMPTRrp28MHpUptVm7C",
"_version" : 1,
"found" : true,
"_source" : {
"EventReceivedTime" : "2016-02-23 13:03:42",
"SourceModuleName" : "iis",
"SourceModuleType" : "im_file",
"date" : "2016-02-23",
"time" : "17:30:49",
"hostname" : "server1.xxx.com"
}
Second:
Now, when I tried delete by hostname:
curl -XDELETE 'http://localhost:9200/logstash-2016.02.23/Nxlogs/_query?q=hostname:server1.xxx.com
Respond:
{"found":false,"_index":"logstash-2016.02.23","_type":"Nxlogs","_id":"_query","_version":1,"_shards":{"total":2,"successful":2,"failed":0}}
Found : false
I tried with other some ways with the same result:
curl -XDELETE 'http://localhost:9200/logstash-2016.02.23/Nxlogs/_query' -d '{ "term" : { "hostname" : "server1.xxx.com" }}
curl -XDELETE 'http://localhost:9200/logstash-2016.02.23/Nxlogs/_query' -d '{ "query": { "term" : { "hostname" : "server1.xxx.com" } }}'
curl -XDELETE 'http://localhost:9200/logstash-2016.02.23/Nxlogs/_query?pretty' -d '{ "query": { "query_string" : { "default_field": "hostname","query": "server1.xxx.com" }}}}'
Someone has ideas?.
Thank you.