The invention relates to a substituted 1,3-miscellaneous azole compound, a preparation method thereof, a pharmaceutical composition containing the substituted 1,3-miscellaneous azole compound and a purpose thereof. The invention relates to the compound in a formula I, or its pharmaceutically acceptable salt, a stereisomer or a solvate, wherein R1, R2, R3 and X are defined as a specification; and the invention also relates to the preparation method, the pharmaceutical composition containing the substituted 1,3-miscellaneous azole compound and the purpose thereof. The compound of the present invention is the novel antituberculous compound, is effective to mycobacterium tuberculosis-susceptible strains, also possesses activity on strains with tolerance on traditional first-line antituberculous drugs such as isoniazide and rifampicin, and has good selectivity to mycobacterium tuberculosis.