1. change pprof module
2. remove memory log
3. remove line hook log
4. send line log to es
This commit is contained in:
Jay
2018-10-12 16:15:47 +08:00
parent a6b8c9ef8a
commit 08ae3289ee
12 changed files with 232 additions and 171 deletions
+9 -2
View File
@@ -5,9 +5,10 @@ import (
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"git.trj.tw/golang/mtfosbot/module/es"
"git.trj.tw/golang/mtfosbot/module/config"
"git.trj.tw/golang/mtfosbot/module/context"
"git.trj.tw/golang/mtfosbot/module/line-message"
@@ -72,7 +73,13 @@ func GetLineMessage(c *context.Context) {
c.DataFormat("body type error")
}
fmt.Println("Line Hook ::: ", string(raw))
jsonMap := make(map[string]interface{})
if err := json.Unmarshal(raw, &jsonMap); err == nil {
es.PutLog("line", jsonMap)
}
defer func() {
jsonMap = nil
}()
events := struct {
Events []*lineobj.EventObject `json:"events"`