Giter VIP home page Giter VIP logo

Comments (7)

giuliocalzolari avatar giuliocalzolari commented on August 18, 2024 1

@EduSandu please check the new version
https://github.com/cloudreach/aws-lambda-es-cleanup/blob/e0f600561e2f0914befb2f8c236658ff47cfe8f0/es-cleanup.py

and test it.

from aws-lambda-es-cleanup.

giuliocalzolari avatar giuliocalzolari commented on August 18, 2024 1

The Regexp done like that

 self.cfg["skip_index"] = self.get_parameter("skip_index", ".kibana*") 

can match multiple patterns/indexes
I will open a new PR with the current changes

@EduSandu thanks for your support!

from aws-lambda-es-cleanup.

giuliocalzolari avatar giuliocalzolari commented on August 18, 2024

@EduSandu that sounds like a great idea.
a similar issue was resolved in #26 would be awesome to have some help from the community to implements regular expression for the index to skip and the index to delete.

I will try a beta version in a dedicate branch

from aws-lambda-es-cleanup.

EduSandu avatar EduSandu commented on August 18, 2024

@giuliocalzolari awesome stuff - tested OK it matched and processed all indexes using the wildcard match and also skipped the .kibana indexes.

I omitted initially during testing to change the skip_index param, which was using the comma-delimited values - the cleaner job deleted the .kibana_N indexes, but was able to restore them from a snapshot.

Wondering if the .split(",") delimeter can be kept and used to separate multiple expressions in the index & skip_index variables?
This gives more granular control and lets you to keep more important indices longer (have them skipped via the expression matching their pattern in skip_index) and drop the ones that are not that relevant earlier, in order to save disk usage.

from aws-lambda-es-cleanup.

giuliocalzolari avatar giuliocalzolari commented on August 18, 2024

@EduSandu uhmm very wierd...
I've setup the skip_index to also use the regexp

self.cfg["skip_index"] = self.get_parameter("skip_index", ".kibana*")

are you using Terraform to deploy it?
because I've realised the default value for terraform is still ".kibana" and this pattern does not match .kibana_N

can you confirm it?

from aws-lambda-es-cleanup.

EduSandu avatar EduSandu commented on August 18, 2024

@giuliocalzolari no this wasn't a new domain standed up using Terraform.
skip_index works using the regexp method, only the initial test cleared the .kibana_N indices (skip_index was still using the prior comma delimited format)

Would like to test having multiple expressions with a , delimeter, for the reasons mentioned above - guessing the following lines

self.cfg["index"] = self.get_parameter("index", ".*")
self.cfg["skip_index"] = self.get_parameter("skip_index", ".kibana*")

should be amended as such? Not sure if re.search will support it
self.cfg["skip_index"] = self.get_parameter("skip_index", ".kibana*").split(",")

from aws-lambda-es-cleanup.

giuliocalzolari avatar giuliocalzolari commented on August 18, 2024

#33

from aws-lambda-es-cleanup.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.