The following command replace the string STR1 with STR2 of every file that is *STR1.
rename s/'STR1'/'STR2'/ *STR1
To change file extension .txt to .log,
rename s/'.txt'/'.log'/ *.txt
The following command replace the string STR1 with STR2 of every file that is *STR1.
rename s/'STR1'/'STR2'/ *STR1
To change file extension .txt to .log,
rename s/'.txt'/'.log'/ *.txt