Skip to content

Commit

Permalink
Able to determine sampling rate using other fields (used by some Cisco)
Browse files Browse the repository at this point in the history
  • Loading branch information
lspgn committed Apr 13, 2018
1 parent 3c6d6fc commit db87c37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion goflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"bytes"
)

const AppVersion = "GoFlow v2.0.0"
const AppVersion = "GoFlow v2.0.1"

var (
FEnable = flag.Bool("netflow", true, "Enable NetFlow")
Expand Down
14 changes: 11 additions & 3 deletions producer/producer_nf.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,17 @@ func SearchNetFlowOptionDataSets(dataFlowSet []netflow.OptionsDataFlowSet) (uint
var found bool
for _, dataFlowSetItem := range dataFlowSet {
for _, record := range dataFlowSetItem.Records {
b := NetFlowPopulate(record.OptionsValues, 34, &samplingRate)
if b { // cannot do found |= NetFlow...
found = b
b := NetFlowPopulate(record.OptionsValues, 305, &samplingRate)
if b {
return samplingRate, b
}
b = NetFlowPopulate(record.OptionsValues, 50, &samplingRate)
if b {
return samplingRate, b
}
b = NetFlowPopulate(record.OptionsValues, 34, &samplingRate)
if b {
return samplingRate, b
}
}
}
Expand Down

0 comments on commit db87c37

Please sign in to comment.