# Delete by query

**URL:** <https://discuss.elastic.co/t/delete-by-query/13130>\
**Category:** Elasticsearch\
**Created:** [August 8, 2013, 3:22pm UTC](https://discuss.elastic.co/t/delete-by-query/13130 "2013-08-08T15:22:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hubert\_Raff](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@Hubert\_Raff](https://discuss.elastic.co/u/Hubert_Raff)\
**Post date:** [August 8, 2013, 3:22pm UTC](https://discuss.elastic.co/t/delete-by-query/13130/1 "2013-08-08T15:22:27Z")

</div>

Hi,

I have a problem with delete by query. I use ES to sort my log access. I  
have one index per day.

In the index of the day before, I would delete all my log access before a  
specific hour.  
For my query I use the plugin Head.

Here is how my data is organized:

hits: {  
\_index: "index"  
\_type: "type"  
\_id: "1"  
\_score: 2.47  
\_source: {  
@tags: ["XXXX"]  
@fields: {  
timestamp: ["08/Aug/2013:17:00:00 +0200"]  
ip: ["XXXX"]  
...  
}  
@server: ["XXXXX"]  
}  
}

When I do

I have  
{

- ok: true
- \_indices: {
  - index: {
    - \_shards: {
      - total: 5
      - successful: 0
      - failed: 5  
}  
}  
}

}

But if I do

It works.

So I try this method with the field "@fields.timestamp". But nothing  
happens. I don't find how I can use this field.

If there isn't solution I will create a new field like server where I will  
copy the field "@fields.timestamp", but I prefer dodge this solution.

Someone have a solution for my problem?

Hubert

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Hubert\_Raff](https://avatars.discourse-cdn.com/v4/letter/h/e79b87/32.png) [@Hubert\_Raff](https://discuss.elastic.co/u/Hubert_Raff)\
**Post date:** [August 12, 2013, 9:46am UTC](https://discuss.elastic.co/t/delete-by-query/13130/2 "2013-08-12T09:46:33Z")

</div>

Someone have a solution for my problem?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:21am UTC](https://discuss.elastic.co/t/delete-by-query/13130/3 "2017-07-06T02:21:37Z")

</div>


