fix
This commit is contained in:
parent
e42cf73564
commit
3594c82039
@ -33,7 +33,8 @@ func PutLog(t string, body map[string]interface{}) (err error) {
|
|||||||
}
|
}
|
||||||
conf := config.GetConf()
|
conf := config.GetConf()
|
||||||
ctx := context.Background()
|
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)
|
_, err = client.Index().Index(conf.Elasticsearch.Index).Type(t).BodyJson(body).Do(ctx)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user