monstache icon indicating copy to clipboard operation
monstache copied to clipboard

delete-strategy per index

Open john08burke opened this issue 3 years ago • 3 comments

This is more of a question, so apologies for posting on the issue tracker but I didn't see a mailing/user list.

Is there a way to use delete-strategy on a per index basis? Currently I have set to ignore all deletes (2) and I use ILM for deletes. There is, however, an index that I don't have under ILM and would like deletes mirrored to ES. It seems to me that the delete-strategy is a global setting. Is there a way to accomplish what I'm after natively from the config? Or should I be looking at writing a go plugin.

Thanks!

john08burke avatar May 05 '22 13:05 john08burke

Hi @john08burke delete-strategy is currently a per process setting and not per collection/index. There would be a couple ways to change this. Maybe a delete-strategy field added to the mapping which allows you to configure individual collections. Or a global delete-regex that is tested against the namespace before doing a deletion. I think either of these approaches would work. Would you be interested in submitting a pull request?

You are correct that as it stands you would need to write a go plugin with a custom Process function that detects and deletes only for the index you are targeting.

Some info on plugins in this issue: https://github.com/rwynn/monstache/issues/298

rwynn avatar May 06 '22 12:05 rwynn

Guide for building a plugin: https://github.com/rwynn/monstache/wiki/Go-plugin-guide

rwynn avatar May 06 '22 12:05 rwynn

Hey @rwynn I like the idea of adding it to the mapping. I will try to put in a PR for this.

john08burke avatar May 06 '22 13:05 john08burke