You can use any mild detergent. Try dish soap or laundry soap in water and then use a wet rag to scrub it out. Rinse with clean water so there is no sticky soap residue because that will attract dirt and make your carpet get dirty. If it is just on the surface and in the carpet (not down in the pad )you shouldn't have any problems.
Cover the spot with BS let it dry and vacum it up. Then I would take a spray bottle with 1/2 cup distilled water, 5 drops TTO & 10 drops Lavender EO mixed in and spray lightly. The smell will be gone and carpet will be disinfected.
I second Momof3's post, works very well. The vinegar solution soaks down into the padding and kills germs. The more vinegar the better. Just check your carpet to see if it bleeds color (do a patch test).
Most carpets love vinegar and baking soda and have no problem.