mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Historical flow enhancements for queries
This commit is contained in:
parent
863da4eca1
commit
ee65e5f143
2 changed files with 21 additions and 5 deletions
|
|
@ -41,12 +41,28 @@ end
|
|||
|
||||
--- ====================================================================
|
||||
|
||||
function getInterfaceFlows(interface_id, version, host, vlan, begin_epoch, end_epoch, limit_low, limit_high)
|
||||
end
|
||||
function getFlowInfo(interface_id, version, flow_idx)
|
||||
version = tonumber(version)
|
||||
|
||||
--- ====================================================================
|
||||
if(version == 4) then
|
||||
sql = "select INET_NTOA(IP_SRC_ADDR) AS IP_SRC_ADDR,INET_NTOA(IP_DST_ADDR) AS IP_DST_ADDR"
|
||||
else
|
||||
sql = "select IP_SRC_ADDR, IP_DST_ADDR"
|
||||
end
|
||||
|
||||
function getHostTopFlows(interface_id, version, host, vlan, begin_epoch, end_epoch, max_num_flows)
|
||||
follow = " ,L4_SRC_PORT,L4_DST_PORT,VLAN_ID,PROTOCOL,FIRST_SWITCHED,LAST_SWITCHED,PACKETS,BYTES,idx,L7_PROTO,CONVERT(UNCOMPRESS(JSON) USING 'utf8') AS JSON from flowsv"..version.."_"..interface_id.." where idx="..flow_idx
|
||||
|
||||
sql = sql .. follow
|
||||
|
||||
if(db_debug == true) then io.write(sql.."\n") end
|
||||
|
||||
res = interface.execSQLQuery(sql)
|
||||
if(type(res) == "string") then
|
||||
if(db_debug == true) then io.write(res.."\n") end
|
||||
return nil
|
||||
else
|
||||
return(res)
|
||||
end
|
||||
end
|
||||
|
||||
--- ====================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue