Yes take him to the vet. That's either a sign of worms or that his anal sacs need expressing (if they burst on their own, look out...lots of STINKY fluid all over your house). In any case, something is bothering him and it's best to get him to the vet.
I agree with the others. Our dog Buddy, may he rest in peace, did this and it was his anal sacs every time. The vet will take care of it and our dog never really minded having it done, it probably gave him relieve. Take him asap because it doesn't get better on its own and you don't want that smelly fluid in your house.