If it doesn't just rinse out then chances are you'll need oxidization or reduction.
For reducer try boiling hot sod met (Craftex's Shift). For oxidization : Chemspec's DyeGone. Be ready with a hand tool to rinse the area out thoroughly once the stain has gone as the product will continue bleaching till its dry. Test the product on the carpet first before using it. Worth going on a stain removal course so you know how to use these products properly.