1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
data.go 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
Berfin Sarı 提交于 2017-10-17 14:46 . Add etcd module (#4970) (#5176)
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
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.1.4

搜索帮助

0d507c66 1850385 C8b1a773 1850385