在REST API中求和两个int变量

时间:2018-01-25 05:11:03

标签: rest elasticsearch

我想在REST API中总结两个整数变量,如下所示:

"aggs": {  
    "download1" : {
        "filter" : { "term": { "IPV4_DST_ADDR":"120.127.160.91"} },
        "aggs" : {
            "downlod_bytes" : { "sum" : { "field" : "IN_BYTES" } }
        }
    },
    "download2" : {
        "filter" : { "term": { "IPV4_SRC_ADDR":"120.127.160.91"} },
        "aggs" : {
            "downlod_bytes" : { "sum" : { "field" : "OUT_BYTES" } }
        }
    },"upload1" : {
        "filter" : { "term": { "IPV4_DST_ADDR":"120.127.160.91"} },
        "aggs" : {
            "upload_bytes" : { "sum" : { "field" : "OUT_BYTES" } }
        }
    },"upload2" : {
        "filter" : { "term": { "IPV4_SRC_ADDR":"120.127.160.91"} },
        "aggs" : {
            "upload_bytes" : { "sum" : { "field" : "IN_BYTES" } }
        }
    }
}   

将download1添加到download2并将upload1添加到upload2 我怎么办?

非常感谢!

0 个答案:

没有答案