Skip to content

Commit

Permalink
fix metrics in live mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sabban committed Oct 22, 2024
1 parent 2b3257e commit a45d358
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/crowdsec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ function csmod.allowIp(ip)
)
-- debug: wip
ngx.log(ngx.DEBUG, "live_query: " .. ip .. " | " .. (ok and "not banned with" or "banned with") .. " | " .. tostring(remediation) .. " | " .. tostring(origin) .. " | " .. tostring(err))
if remediation ~= nil and remediation ~= "none" then
metrics:increment(origin,1)
if remediation ~= nil and remediation == "ban" then
metrics:increment("dropped/" .. origin,1)
return ok, remediation, err
end
end
Expand Down

0 comments on commit a45d358

Please sign in to comment.