代码拉取完成,页面将自动刷新
package store
import (
"encoding/json"
"github.com/elastic/beats/libbeat/common"
s "github.com/elastic/beats/libbeat/common/schema"
c "github.com/elastic/beats/libbeat/common/schema/mapstriface"
)
var (
schema = s.Schema{
"gets": s.Object{
"success": c.Int("getsSuccess"),
"fail": c.Int("getsFail"),
},
"sets": s.Object{
"success": c.Int("setsSuccess"),
"fail": c.Int("setsFail"),
},
"delete": s.Object{
"success": c.Int("deleteSuccess"),
"fail": c.Int("deleteFail"),
},
"update": s.Object{
"success": c.Int("updateSuccess"),
"fail": c.Int("updateFail"),
},
"create": s.Object{
"success": c.Int("createSuccess"),
"fail": c.Int("createFail"),
},
"compareandswap": s.Object{
"success": c.Int("compareAndSwapSuccess"),
"fail": c.Int("compareAndSwapFail"),
},
"compareanddelete": s.Object{
"success": c.Int("compareAndDeleteSuccess"),
"fail": c.Int("compareAndDeleteFail"),
},
"expire": s.Object{
"count": c.Int("expireCount"),
},
"watchers": c.Int("watchers"),
}
)
func eventMapping(content []byte) common.MapStr {
var data map[string]interface{}
json.Unmarshal(content, &data)
event, _ := schema.Apply(data)
return event
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。