Core body temperature measurement using an ingestible pill has been proven effective for field-based ambulatory applications. The ingestible pill overcomes many impracticalities related with traditional methods of assessing core body temperature, however, it suffers from two key issues: random gaps due to missing data and outliers due to electromagnetic intereference. In this paper, we propose a principled convex optimization based framework for preprocessing the raw core body temperature signal. The proposed framework assumes that the raw core body temperature signal consists of two components: a smooth low-frequency component and a transient component with sparse outliers. We derive a computationally efficient algorithm using the majorization-minimization procedure and show its performance on simulated data. Finally, we demonstrate utility of the proposed method for estimating the circadian rhythm of core body temperature in cognitively normal elderly.