The undertaking must be filed by the magistrate in the office of the clerk of the district court.
Idaho Code § 19-214