title: Is it possible to use Kibana generated query to delete from Elasticsearch?
body: <p>I have accidentally loaded some data into Elasticsearch from Logstash.  </p>
  
  <p>Basically, I forgot to include <code>start_position =&gt; "beginning"</code> in the Logstash config, so if I delete <code>.sincedb_*</code> and re-run I'll have a small portion of data that is duplicated.</p>
  
  <p>I've used Kibana to see this data and clicked on the "inspect" button to see the query it has run:</p>
  
  <pre><code>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
  }'
  </code></pre>
  
  <p>If I run this on the ELS server, it finds the same result set (as expected):</p>
  
  <pre><code>{
    "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
        } ]
      }
    }
  }
  </code></pre>
  
  <p>The line <code>"count" : 91</code> matches the same number of events shown in Kibana.</p>
  
  <p>How do I turn this into a DELETE operation to remove these 91 entries?</p>
  
  <p>Thanks,<br>
  KB</p>