...
|
...
|
@@ -158,6 +158,23 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
}
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
String reason="{\"deviceTypeCount\":1,\"difMethodCount\":6,\"impApiPrecent\":100,\"impCount\":221,\"ip\":\"39.107.73.223\",\"ipPrecent\":0,\"loginApiCount\":61,\"methodDetail\":{\"smart.forward.go\":61,\"app.Seckill.payment\":20,\"user.instalment.activate\":19,\"app.Shopping.payment\":41,\"app.Shopping.easySubmit\":20,\"app.shopping.depositPayment\":60},\"notExistUdidPercent\":0,\"notExsitUdidCount\":0,\"qps\":221,\"timestamp\":1519969986974,\"udidCount\":1,\"uidCount\":1,\"whiteIpFlag\":false}";
|
|
|
String smsStr = "成功捕获恶意ip--->" + "12.2.2.2" + ",接口列表[";
|
|
|
JSONObject json = JSONObject.parseObject(reason);
|
|
|
if (json != null && !json.isEmpty()) {
|
|
|
JSONObject methodDetail = json.getJSONObject("methodDetail");
|
|
|
if (methodDetail != null && !methodDetail.isEmpty()) {
|
|
|
for (Map.Entry<String, Object> entry : methodDetail.entrySet()) {
|
|
|
smsStr += entry.getKey() + ":" + entry.getValue() + ",";
|
|
|
}
|
|
|
smsStr = smsStr.substring(0, smsStr.length() - 1);
|
|
|
}
|
|
|
}
|
|
|
smsStr += "]";
|
|
|
System.out.println(smsStr);
|
|
|
}
|
|
|
|
|
|
private void writeAlarmMipsInfoToOpsDb(JSONArray ipsObjArray){
|
|
|
logger.info("begin writeAlarmMipsInfoToOpsDb :"+ipsObjArray);
|
|
|
for(int i=0;i<ipsObjArray.size();i++){
|
...
|
...
|
|