If you're not seeing any other symptoms, there are two things you can try for this problem. First of all, if you're not already feeding your bunny all the good-quality timothy hay he'll eat, buy him some. Don't use alfalfa, as that can lead to health problems. You should be able to buy bags of timothy hay in most pet stores. Not getting enough roughage can lead to problems such as you are seeing. Timothy hay should be the mainstay of a rabbit's diet at all times. If you'd like to read more about proper rabbit feeding:
Second, it would be good to give the rabbit some probiotics. There's a brand called Benebac that you can sometimes find in pet stores, feed stores, or farm stores. If you can't find it, you can use human propbiotics, as long as you're sure to get the dairy-free kind. You can buy liquid ones in health food stores. Most rabbits will eat a tiny piece of bread with the probiotics dripped on to it. Keep the bread very small because it's not a good food for rabbits, but just a way to get them to eat the probiotics. You can also put some of the liquid into the side of the rabbit's mouth with a syringe. Don't put it straight down his throat as that can lead to aspiration into the lungs.
If your bunny has any other symptoms - diarrhea, constipation, loss of appetite, lethargy - you shouldn't wait, but should take him to a vet. Check to make sure the discharge is from the anus. If it should happen to be urine, that's cause for a vet visit, too. Also, if the discharge doesn't stop after two weeks of using the hay and probiotics, you should contact a vet. This link will take you to a directory of rabbit vets:
If you have any more questions about this, just let me know by clicking on REPLY.
(If you find my answer helpful, please click on ACCEPT. Thank you.)