The defendant may file a claim of exemption with the levying officer or the court if the levy is made upon personal property. The claim must be filed within 30 days after the defendant was served with the notice of attachment by the sheriff. If the levy is on real property, the claim may be filed any time before entry of judgment in the lawsuit. (CCP 485.610, 482.100, 703.510)