Unable to delete the indices using Delete api

HI Team
I have accumulated some really bad indices in my elastic datastore. These indices were created because of incorrect fields name which were used while indexing them.

Example Index Name:
 
projectname-logtype-%{log_source}-2019.02.01 

while most of the indices were successfully created, there are some with %{log_source} which seems to have come from some indefinite source.

Delete index name does not allow me to delete the same.

Examples:

project-log-%{log_source}-2019.01.01
project-log-%{log_source}-2019.01.02
project-log-%{log_source}-2019.01.03

Try to escape or URL encode those index names.

can you share the code which you tried to delete the index