In e-learning, detecting student behavior in interacting with the Learning Management system (LMS) is needed to create personalized learning. Analysis of the learning context is carried out to obtain patterns of student behavior in the teaching and learning process. This paper aims to detect student behavior in e-learning as a supporter of the analysis of the learning context. Student behavior patterns were obtained from LMS data and social demographic profile from the Student Information System (SIS). In processing the data set in this research uses the Exploratory Data Analysis and Machine Learning approach. This research was conducted on students participating in the e-learning course in Basic Physics 1 Open University consisting of 118 students from four study programs of various ages, regions, and length of study. The results of the study using the K-means method showed that there were three potential groups of student behavior patterns that followed e-learning. Based on the Spearman Correlation analysis, the relationship between context and student behavior in e-learning was weak but statistically significant (p <0.05). The behavior patterns of students interacting were also low, with only 19% interacting with other students, and 9% interacting with lecturers. Therefore, this study will further make recommendations that are relevant to student behavior and context for the development of e-learning systems and their evaluation methods that fit the characteristics of students in achieving better learning outcomes.