If micromachining of an optical fiber with a three-dimensional structure could be performed, optical fibers would be more useful as devices with novel functions for communication instruments and sensors. The fabrication of a photon scanning tunnelling microscope (PSTM) fiber probe by wet chemical etching in a buffered hydrofluoric acid and micrometer-scale taps in a cladding by laser ablative chemical etching has been reported. However, a simple fabrication method for various configurations, such as lathe machining of optical fibers with high accuracy, has not been reported. For example, an optical fiber with some cladding in the middle region removed can be applied as a variable attenuator. In the case, the quantity of outgoing evanescent waves from the optical fiber depends on the type of material (or its position) surrounding the region from which the cladding has been removed. In this paper, micromachining of an optical fiber by reactive ion etching (RIE) and its application are discussed.