This paper presents a machine learning-based method to build knowledge bases used to carry out surveillance tasks in environments monitored with video cameras. The method generates three sets of rules for each camera that allow to detect objects' anomalous behaviours depending on three parameters: object class, object position, and object speed. To deal with uncertainty and vagueness inherent in video surveillance we make use of fuzzy logic. Thanks to this approach we are able to generate a set of rules highly interpretable by security experts. Besides, the simplicity of the surveillance system offers high efficiency and short response time. The process of building the knowledge base and how to apply the generated sets of fuzzy rules is described in depth for a real environment.