如何根据 tag
(来自服务)总计 host
(来自iptag)总计?例如:如果 host
匹配 tagAAA 过滤条件,则总计+ = 1.
hostmin <= ip2int(host) <= hostmax
收集服务:
db.getCollection('services').insert({"host" : "172.21.4.205", "port" : 80, "service" : "http"})
db.getCollection('services').insert({"host" : "172.21.4.97", "port" : 445, "service" : "smb"})
收集 iptag :
db.getCollection('iptag').insert({
"tag" : [
"tagAAA"
],
"hostmin" : 2886991873.0,
"hostmax" : 2887057406.0,
"cidr" : "172.20.0.0/16"
}
db.getCollection('iptag').insert({
"tag" : [
"tagBBB"
],
"hostmin" : 2887057409.0,
"hostmax" : 2887122942.0,
"cidr" : "172.21.0.0/16"
}