diff --git a/elastalert/alerts.py b/elastalert/alerts.py index d3fa7518..f2f31853 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') diff --git a/requirements.txt b/requirements.txt index c66ca8d7..9c32052d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,6 @@ prison>=0.1.2 py-zabbix==1.1.3 PyStaticConfiguration>=0.10.3 python-dateutil>=2.6.0,<2.7.0 -python-magic>=0.4.15 PyYAML>=5.1 requests>=2.0.0 stomp.py>=4.1.17 diff --git a/setup.py b/setup.py index 30ef9495..2845836a 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,6 @@ 'stomp.py>=4.1.17', 'texttable>=0.8.8', 'twilio>=6.0.0,<6.1', - 'python-magic>=0.4.15', 'cffi>=1.11.5' ] )