Sum two int variable in REST


(張皓翔) #1

Hi everyone, I want to sum two integer variable in REST API such like below:

  "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" } }
            }
        }
    }   

add download1 to download2 and add upload1 to upload2
how can I do?

thanks a lot!


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.