-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new feature: aggregation and order by #10
Comments
|
Hi Gabe, |
@phaag no rush, I've managed to do some workarounds here to downsample, still, this a desired feature. Do you think For now I just read the entire nffile, then sort the slice and downsample records that have 'less than x packets'. |
@gabrielmocan - I've created a new branch Changes in existing code: Example - simply list all records if recordChannel, err := nffile.AllRecords().Get(); err != nil {
fmt.Printf("Failed to process flows: %v\n", err)
} else {
for record := range recordChannel {
record.PrintLine()
}
} The new chain processing function is: You will find some example code in the folder if recordChannel, err := nffile.AllRecords().OrderBy("bytes", nfdump.DESCENDING).Get(); err != nil {
fmt.Printf("Failed to process flows: %v\n", err)
} else {
for record := range recordChannel {
record.PrintLine()
}
} Please send me your feedback. With your feedback integrated, I can merge the |
@phaag will do some testing and feedback to you. Thanks in advance! |
|
@phaag after some testing, the function is working as expected. We can try |
@phaag after further testing, I noticed that if nffile has more than 1024*1024 records, the code panics. I've tracked this down to these default values in
If I change these default values to greater than the flow count, panic is gone. Could we create those slices based on Sample sent via e-mail. |
It's fixed in work branch. Please test! |
It works just fine 😎 |
Hi Pete, so long in this project.
It's working very nice, but I may ask a few features?
My biggest problem currently are very large flow data, mostly due to DDoS attacks. I have a few exporters that sometimes push more than 300MB of data in a single minute, going above 3M flows in the nffile.
I would like to be able to aggregate fields, pretty much like the
-A
parameter from classic nfdump. Also, an equivalent to-O
to order by the output.My intention is to do some sort of downsampling in those cases. Some kind of 'aggregate by values < x'. I'm open to ideas also.
The text was updated successfully, but these errors were encountered: