IntroductionStringent regulations in pig farming, such as antibiotic control and the ban on certain additives and disinfectants, complicate disease control efforts. Despite the evolution of microbial communities inside the house environment, they maintain stability over the years, exhibiting characteristics specific to each type of production and, in some cases, unique to a particular company or farm production type. In addition, some infectious diseases are recurrent in specific farms, while other farms never present these diseases, suggesting a connection between the presence of these microorganisms in animals or their environment. Therefore, the aim of this study was to characterise environmental microbiomes of farms with high and low sanitary status, establishing the relationships between both, health status, environmental microbial ecology and its functionality.MethodsFor this purpose, 6 pig farms were environmentally sampled. Farms were affiliated with a production company that handle the majority of the pigs slaughtered in Spain. This study investigated the relationship among high health and low health status farms using high throughput 16S rRNA gene sequencing. In addition, to identify ecologically relevant functions and potential pathogens based on the 16S rRNA gene sequences obtained, functional Annotation with PROkaryotic TAXa (FAPROTAX) was performed.Results and DiscussionThis study reveals notable differences in microbial communities between farms with persistent health issues and those with good health outcomes, suggesting a need for protocols tailored to address specific challenges. The variation in microbial populations among farms underscores the need for specific and eco-friendly cleaning and disinfection protocols. These measures are key to enhancing the sustainability of livestock farming, ensuring safer products and boosting competitive edge in the market.