Make the Spice Paste: Heat 2tsp ghee in a pan; add all the ingredients for the spice paste and fry till they smell fragrant. Make sure not to burn them. Cool and grind to a fine paste adding very little water.
Pressure cook the dal.
To the cooked dal, add 1cup water, tomato, salt and simmer till the tomatoes are tender.
Add the ground spice paste and simmer for 2 minutes.
Heat 2tsp ghee in a small pan; add all the ingredients for tempering. When the seeds start to splutter, add it to the rasam. Turn off the heat.
Pour in the sour buttermilk. Mix well. Serve hot with rice.