Skip to content

Commit

Permalink
add size to s3.bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
matteopasa committed Feb 2, 2024
1 parent 58c7c01 commit a14366f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/cloudtrail/pkg/cloudtrail/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,22 @@ func getfieldU64(jdata *fastjson.Value, field string) (bool, uint64) {
if out != nil {
tot = tot + getvalueU64(out)
}
return (in != nil || out != nil), tot
size := jdata.Get("detail", "object", "size")
if size != nil {
tot = tot + getvalueU64(size)
}
return (in != nil || out != nil || size != nil), tot
case "s3.bytes.in":
var tot uint64 = 0
in := jdata.Get("additionalEventData", "bytesTransferredIn")
if in != nil {
tot = tot + getvalueU64(in)
}
return (in != nil), tot
size := jdata.Get("detail", "object", "size")
if size != nil {
tot = tot + getvalueU64(size)
}
return (in != nil || size != nil), tot
case "s3.bytes.out":
var tot uint64 = 0
out := jdata.Get("additionalEventData", "bytesTransferredOut")
Expand Down

0 comments on commit a14366f

Please sign in to comment.