You could do this in bash:
for index in `find /opt/splunk/var/lib/splunk -type d -name "EngLog_*"`
/opt/splunk/bin/splunk clean eventdata -index $index -f
Just be careful and try the find command outside of the script first!
There are a few directories that are not actual indexes, within that base directory. While they don't start with
EngLog_*, I figure that other people may look at this answer as a pattern...
Doesn't seem like it accepts wildcard (splunk clean eventdata -index