diff --git a/elastalert/alerts.py b/elastalert/alerts.py index d3fa7518f..f2f31853f 100644 --- a/elastalert/alerts.py +++ b/elastalert/alerts.py @@ -868,7 +868,9 @@ def create_default_title(self, matches, for_search=False): if for_search: return title - title += ' - %s' % (pretty_ts(matches[0][self.rule['timestamp_field']], self.rule.get('use_local_time'))) + timestamp = matches[0].get(self.rule['timestamp_field']) + if timestamp: + title += ' - %s' % (pretty_ts(timestamp, self.rule.get('use_local_time'))) # Add count for spikes count = matches[0].get('spike_count')