Skip to content

Commit

Permalink
cmd_acc: added report for most active source IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 1, 2024
1 parent cb0ca0e commit 3115f77
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kamcli/commands/cmd_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def acc_report(ctx, oformat, ostyle, limit, interval, name):
- top-src: most active callers
- top-dst: most active callees
- top-odst: most active original callees
- top-srcip: most active source IP addresses
"""
e = create_engine(ctx.gconfig.get("db", "rwurl"))
ctx.vlog("Showing accounting report: " + name)
Expand All @@ -538,6 +539,8 @@ def acc_report(ctx, oformat, ostyle, limit, interval, name):
qfield = "dst_user"
elif name == "top-odst":
qfield = "dst_ouser"
elif name == "top-srcip":
qfield = "src_ip"

query = "SELECT `" + qfield + "`, count(*) AS `count` FROM acc"

Expand Down

0 comments on commit 3115f77

Please sign in to comment.