title: Delete data older than 10 days in elasticsearch
body: <p>I am new to elasticsearch and I want to delete documents in my elasticsearch index which are older than 10 days. I want to keep only last 10 days of data.So is there any way to delete last 11nth day index automatically.
  What I have tried..</p>
  
  <pre><code>DELETE logstash-*/_query
  {
   "query": {
     "range": {
       "@timestamp": {
         "lte": "now-10d"
        }
      }
    }
  }
  </code></pre>
  
  <p>Error I'm getting while running on kibana dev tools</p>
  
  <pre><code>{
  "error": "Incorrect HTTP method for uri [/logstash-*/_query?pretty] and method [DELETE], 
  allowed: [POST]",
  "status": 405
  }
  </code></pre>
  
  <p>Please help to resolve this issues.</p>