In their lifetime, animals experience various environmental perturbations, such as heat stress, a disease or a change in feed, which require a response. Animals differ in their capacity to respond to various perturbations; this is called resilience, which is the capacity of animals to be minimally affected by perturbations or to rapidly return to the state before exposure to perturbations. The main obstacle in research on genetics of resilience is how to define and quantify resilience. Big data offers great opportunities because longitudinal profiles of animals, such as feed intake, body weight, milk yield or egg production, contain information about how animals respond to perturbations. The objectives of our research were to define resilience indicators and estimate heritable variation in resilience indicators and to estimate associations with existing health and longevity traits to assess the utility of resilience indicators to improve resilience by breeding. The resilience indicators studied were log-transformed variance of deviations (LnVar), lag-1 autocorrelation (Auto) of deviations and skewness of deviations (Skew) based on daily milk yield in dairy cattle and four-weekly body weight measures in laying hens. In dairy cattle, we estimated a heritability of 0.20–0.24 for LnVar, a heritability of 0.08–0.10 for Auto, and a heritability of 0.01 for Skew. The strongest genetic correlations between a resilience indicator and existing health and longevity traits were found for LnVar with udder health (-0.22 to -0.33), ketosis (-0.27 to -0.33) and longevity (-0.29 to -0.34). In laying hens, we estimated similar heritabilities for the three resilience indicators: 0.10 for LnVar, 0.11 for Auto, and 0.09 for Skew. We found predictive value of LnVar breeding values for lesion scores after challenge with an E-coli infection. These results show that especially the variance of deviations is a promising resilience indicator to improve resilience and health in animals by genetic selection.