This paper introduces a technique using a k-nearest neighbor (k-NN) classifier and hybrid features extracted from acoustic emission (AE) signals for detecting leakages in a gas pipeline. The whole algorithm is embedded in a microcontroller unit (MCU) to detect leaks in real-time. The embedded system receives signals continuously from a sensor mounted on the surface of a gas pipeline to diagnose any leak. To construct the system, AE signals are first recorded from a gas pipeline testbed under various conditions and used to synthesize the leak detection algorithm via offline signal analysis. The current work explores different features of normal/leaking states from corresponding datasets and eliminates redundant and outlier features to improve the performance and guarantee the real-time characteristic of the leak detection program. To obtain the robustness of leak detection, the paper normalizes features and adapts the trained k-NN classifier to the specific environment where the system is installed. Aside from using a classifier for categorizing normal/leaking states of a pipeline, the system monitors accumulative leaking event occurrence rate (ALEOR) in conjunction with a defined threshold to conclude the state of the pipeline. The entire proposed system is implemented on the 32F746G-DISCOVERY board, and to verify this system, numerous real AE signals stored in a hard drive are transferred to the board. The experimental results show that the proposed system executes the leak detection algorithm in a period shorter than the total input data time, thus guaranteeing the real-time characteristic. Furthermore, the system always yields high average classification accuracy (ACA) despite adding a white noise to input signal, and false alarms do not occur with a reasonable ALEOR threshold.