You could do this in bash:
for index in `find /opt/splunk/var/lib/splunk -type d -name "EngLog_*"`
do
/opt/splunk/bin/splunk clean eventdata -index $index -f
done
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...
Guess that will work. Was hoping there was a more simple way
Doesn't seem like it accepts wildcard (splunk clean eventdata -index