How can I delete all the stored scripts?

This way I can delete 1:
DELETE _scripts/my_script

I just want to delete them all, I don't know the list of scripts I have stored.

There is not currently any way to do this. There is an open issue (https://github.com/elastic/elasticsearch/issues/25179) to be able to retrieve all scripts, which would be similar to this. You could open a new feature request issue, or start by mentioning the idea on that issue.

To know what you have stored:

GET _cluster/state/metadata?pretty&filter_path=**.stored_scripts

From this, know that you get this info from the cluster state, you can toy with the filter to filter server side if desired, or not...Then build on this for automation, or simply get the list once and ref it if you want to manually delete something, see what's there.

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