phaag / go-nfdump

go-nfdump: A Go module to read and process nfdump files
BSD 2-Clause "Simplified" License
7 stars 1 forks source link

README example not working #2

Closed gabrielmocan closed 1 year ago

gabrielmocan commented 1 year ago

I'm starting to experiment with go-nfdump but I can't reproduce the initial example given on README.

I've tried with different samples from different brands but no luck.

go run ./main.go -r /NE40.sample
nffile: Magic : 0xa50c Version : 2 NfVersion : 0x1070100 Created : 1675039740 Compression : 0 Encryption : 0 appendixBlocks : 1 unused : 0 offAppendix : 14148640 BlockSize : 0 NumBlocks : 14 Ident : NE40Av01-CJ Stat : {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} record: 1

panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x58 pc=0x1043aa024] goroutine 1 [running]: github.com/phaag/go-nfdump.(*FlowRecordV3).GenericFlow(...) /Users/gabemocan-mw/go/pkg/mod/github.com/phaag/go-nfdump@v0.0.2/record.go:73 main.main() /Users/gabemocan-mw/teste/main.go:46 +0x344 exit status 2 ----------------------------------------------------------------------------------------------- go run ./main.go -r RB.sample nffile: Magic : 0xa50c Version : 2 NfVersion : 0xf1070100 Created : 1674671760 Compression : 0 Encryption : 0 appendixBlocks : 1 unused : 1 offAppendix : 518820 BlockSize : 0 NumBlocks : 1 Ident : RB-QG-MW-SOLUCOES Stat : {0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0} record: 1 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x58 pc=0x10241a024] goroutine 1 [running]: github.com/phaag/go-nfdump.(*FlowRecordV3).GenericFlow(...) /Users/gabemocan-mw/go/pkg/mod/github.com/phaag/go-nfdump@v0.0.2/record.go:73 main.main() /Users/gabemocan-mw/teste/main.go:46 +0x344 exit status 2
gabrielmocan commented 1 year ago

I've sent both samples via e-mail.

phaag commented 1 year ago

Thanks! A stupid bug. It works now.