If you have a rug that does not show the dirt but just needs cleaning, my carpet man told me to use a vinegar water solution. Like 1C vinegar to 3C water.
Now if you have a light colored rug I am not sure. You might want to try a mixture of water and oxiclean. Make sure the oliclean is dissolved before you put it in the machine. tk##