# Delete/pseudonomize entries selectively?

**URL:** <https://discuss.elastic.co/t/delete-pseudonomize-entries-selectively/118398>\
**Category:** Elasticsearch\
**Created:** [February 5, 2018, 7:52am UTC](https://discuss.elastic.co/t/delete-pseudonomize-entries-selectively/118398 "2018-02-05T07:52:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nielskob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nielskob/32/27359_2.png) [@nielskob](https://discuss.elastic.co/u/nielskob)\
**Post date:** [February 5, 2018, 7:52am UTC](https://discuss.elastic.co/t/delete-pseudonomize-entries-selectively/118398/1 "2018-02-05T07:52:50Z")

</div>

I use elasticsearch with fluentd and kibana as a logserver. Now I have the problem that I need to delete or pseudonomize logs after a certain time because of data  
I.e.: all logs sent from dovecot should be kept only for 7 days and all apache-logs should get their IPs pseudonomized after 24 hours because of data protection laws. General system logs can be kept indefinitely. How can I realize something like that with elasticsearch?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 5, 2018, 8:50am UTC](https://discuss.elastic.co/t/delete-pseudonomize-entries-selectively/118398/2 "2018-02-05T08:50:12Z")

</div>

Use time-based indices and place data with different retention requirements in different indices. In order to change data after a certain time you will need to reindex, e.g. by using the [update by query API](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docs-update-by-query.html), potentially together with an [ingest node pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/6.1/pipeline.html) to handle the transformation.

---

<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:** [March 5, 2018, 8:50am UTC](https://discuss.elastic.co/t/delete-pseudonomize-entries-selectively/118398/3 "2018-03-05T08:50:18Z")

</div>

Closed on March 5, 2018, 8:50am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
