Hi Sir or Madam,
It is not unusual for an intact male dog to have a slight discharge that is yellowish white or whitish. It is called smegma. When an intact male dog is in puberty, it is not all that unusual to see a slight greenish discharge. It usually resolves itself as the dog ages.
If the discharge is greenish/yellowish or your dog is having other symptoms like straining to urinate, blood in the urine or excessive licking of his penis, or is neutered, it could indicate an infection and should be checked by your Vet. I hope this information is helpful to you..
If he is neutered, he really shouldn't be having much discharge. They will occassionally have a little white discharge, but it doesn't usually bother them much. Your post indicated that he might have discomfort in the area, which might indicate an infection starting. At this point, keep the area as clean as you can with plain baby wipes or a warrm wash clothe. If he doesn't have any other symptoms, I would monitor him. Be sure to look for a change in color, increase in the amount of discharge, itchiness, increase in urination, blood in the urine or from the penis or increase in urination that might indicate that another situation is present.