Skip to content

Commit

Permalink
update function per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
legoguy1000 committed May 4, 2021
1 parent c5b7cc5 commit ef2ca1b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions libbeat/processors/communityid/communityid.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,22 @@ func tryToUint(from interface{}) (uint, bool) {
return uint(v), true
case int8:
return uint(v), true
case int16:
return uint(v), true
case int32:
return uint(v), true
case int64:
return uint(v), true
case uint:
return uint(v), true
case uint8:
return uint(v), true
case uint16:
return uint(v), true
case uint32:
return uint(v), true
case uint64:
return uint(v), true
case string:
num, err := strconv.ParseUint(v, 0, 64)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"ts":1547188415.857497,"uid":"CAcJw21BbVedgFnYH3","id.orig_h":"192.168.86.167","id.orig_p":38339,"id.resp_h":"192.168.86.1","id.resp_p":53,"proto":"udp","service":"dns","duration":0.076967,"orig_bytes":75,"resp_bytes":178,"conn_state":"SF","local_orig":true,"local_resp":true,"missed_bytes":0,"history":"Dd","orig_pkts":1,"orig_ip_bytes":103,"resp_pkts":1,"resp_ip_bytes":206,"tunnel_parents":[]}
{"ts":1547188416.857497,"uid":"CAcJw21BbVedgFnYH4","id.orig_h":"192.168.86.167","id.orig_p":38340,"id.resp_h":"8.8.8.8","id.resp_p":53,"proto":"udp","service":"dns","duration":0.076967,"orig_bytes":75,"resp_bytes":178,"conn_state":"SF","local_orig":true,"local_resp":false,"missed_bytes":0,"history":"Dd","orig_pkts":1,"orig_ip_bytes":103,"resp_pkts":1,"resp_ip_bytes":206,"tunnel_parents":[]}
{"ts":1547188417.857497,"uid":"CAcJw21BbVedgFnYH5","id.orig_h":"4.4.2.2","id.orig_p":383341,"id.resp_h":"8.8.8.8","id.resp_p":53,"proto":"udp","service":"dns","duration":0.076967,"orig_bytes":75,"resp_bytes":178,"conn_state":"SF","local_orig":false,"local_resp":false,"missed_bytes":0,"history":"Dd","orig_pkts":1,"orig_ip_bytes":103,"resp_pkts":1,"resp_ip_bytes":206,"tunnel_parents":[]}
{"ts":1547188417.857497,"uid":"CAcJw21BbVedgFnYH5","id.orig_h":"4.4.2.2","id.orig_p":38341,"id.resp_h":"8.8.8.8","id.resp_p":53,"proto":"udp","service":"dns","duration":0.076967,"orig_bytes":75,"resp_bytes":178,"conn_state":"SF","local_orig":false,"local_resp":false,"missed_bytes":0,"history":"Dd","orig_pkts":1,"orig_ip_bytes":103,"resp_pkts":1,"resp_ip_bytes":206,"tunnel_parents":[]}
{"ts":1551399000.57855,"uid":"Cc6NJ3GRlfjE44I3h","id.orig_h":"192.0.2.205","id.orig_p":3,"id.resp_h":"198.51.100.249","id.resp_p":3,"proto":"icmp","conn_state":"OTH","local_orig":false,"local_resp":false,"missed_bytes":0,"orig_pkts":1,"orig_ip_bytes":107,"resp_pkts":0,"resp_ip_bytes":0,"tunnel_parents":[]}
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"input.type": "log",
"log.offset": 792,
"network.bytes": 309,
"network.community_id": "1:9xAq+MIBct9Is73ErTrU/RZ+Nq0=",
"network.community_id": "1:7pTO7SRt6R5Ms7DZet2wPuZnXSs=",
"network.direction": "external",
"network.packets": 2,
"network.protocol": "dns",
Expand All @@ -161,7 +161,7 @@
"source.geo.location.lon": -97.822,
"source.ip": "4.4.2.2",
"source.packets": 1,
"source.port": 383341,
"source.port": 38341,
"tags": [
"zeek.connection"
],
Expand Down Expand Up @@ -192,7 +192,7 @@
],
"fileset.name": "connection",
"input.type": "log",
"log.offset": 1181,
"log.offset": 1180,
"network.bytes": 107,
"network.community_id": "1:gzTID87+KHoT4RFDSqb5aInTPeg=",
"network.direction": "external",
Expand Down

0 comments on commit ef2ca1b

Please sign in to comment.