In this paper, we propose a new approach for efficient and real-time tracking of the moving objects in sensor networks by mining the movement log. In our approach, we first conduct the hierarchical clustering to form a hierarchical model for the sensor nodes. Secondly, the movement logs of the moving objects are analyzed by a data mining algorithm to obtain the movement rules, which are then used to predict the next position of a moving object. Besides, we use the multi-level structure to represent the hierarchical relations among sensors so as to achieve the goal of keeping track of moving objects in real-time. Through experimental evaluation on various simulation conditions, the proposed method is shown to deliver excellent performance in terms of both energy efficiency and timeliness.