From 3594c82039c21c2193b73e71acbef111c1bbba13 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 10 Oct 2018 01:23:43 +0800 Subject: [PATCH] fix --- module/es/es.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/es/es.go b/module/es/es.go index fe22738..3ce4acb 100644 --- a/module/es/es.go +++ b/module/es/es.go @@ -33,7 +33,8 @@ func PutLog(t string, body map[string]interface{}) (err error) { } conf := config.GetConf() ctx := context.Background() - body["timestamp"] = time.Now().UnixNano() + body["timestamp"] = time.Now().UnixNano() / 1000000 + body["date"] = time.Now().UTC() _, err = client.Index().Index(conf.Elasticsearch.Index).Type(t).BodyJson(body).Do(ctx) return }