Filter field by percentage

This is something a Bucket script aggregation | Elasticsearch Guide [7.15] | Elastic would be best used to do.

I'm not great with scripting, but Need help to calculate percentage in watcher has something that might get you started.