Elasticsearch Timestamp in UTC

Elasticsearch timestamps are expected to be in UTC. Currently the returner sends the timestamp in localtime.
This commit is contained in:
Clint Armstrong 2015-02-19 11:07:18 -05:00
parent b70ffe2bb8
commit e84b5c530e

View File

@ -141,7 +141,7 @@ def returner(ret):
''' '''
es_ = _get_instance() es_ = _get_instance()
_create_index(es_, __salt__['config.get']('elasticsearch:index')) _create_index(es_, __salt__['config.get']('elasticsearch:index'))
the_time = datetime.datetime.now().isoformat() the_time = datetime.datetime.utcnow().isoformat()
ret['@timestamp'] = the_time ret['@timestamp'] = the_time
es_.index(index=__salt__['config.get']('elasticsearch:index'), es_.index(index=__salt__['config.get']('elasticsearch:index'),
doc_type='returner', doc_type='returner',