Skip to content
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

request/intent for PR: using nfdump as a library #194

Open
martinpaljak opened this issue Nov 6, 2019 · 4 comments
Open

request/intent for PR: using nfdump as a library #194

martinpaljak opened this issue Nov 6, 2019 · 4 comments
Labels
Feature request Feature request

Comments

@martinpaljak
Copy link

Thanks for a great tool!

What is the recommended method of using nfdump as an external library for reading nfcapd data?

I'm in the process of making nfdump and moloch play together (read: piping nfcapd flows via moloch-capture pipeline as "dataless sessions" to be viewed and queried in moloch UI).

Integration is currently based on nfreader.c sample and it "seems to work OK, on my machine".

What I've done this far works with some hand-crafted code to please compiler and make things link, but for simple "--with-nfdump=/prefix" kind of inclusion some adjustments to the headers and build machinery should be done, IMHO.

Is there something missing from my radar, something planned in this field, or something where PR-s would be welcome?

@phaag
Copy link
Owner

phaag commented Dec 5, 2019

Using nfreader is indeed the preferred way to craft an interface of your choice. The nfreader code coming with nfdump is guaranteed to work. However, you can code your own reader. Everything you need is nffile.h with it's definitions.
There might be a GO interface one day to read nfdump files with Apps written with Golang.
Hope, this helps

@phaag phaag closed this as completed Dec 5, 2019
@martinpaljak
Copy link
Author

martinpaljak commented Dec 6, 2019

I'd like to re-open this, as it was not just a notice but to be followed with a PR.

To make things work for moloch-nfdump (nfdump data importer for moloch, see https://github.com/martinpaljak/moloch/wiki) manual fuss is needed to make nfdump header layout work from an external project. Namely:

  • conflict of "config.h"
  • clearer separation of internal and external headers.

Right now this makes it compile semi-cleanly:

martinpaljak/moloch@5aa6408#diff-05e4d1c315718a1c74a8a45b096525a3R29-R60

https://github.com/martinpaljak/moloch/blob/nfdump/configure.ac#L356-L357

@phaag
Copy link
Owner

phaag commented Feb 22, 2020

I can reopen this, but changes won't be ready soon.

@phaag phaag reopened this Feb 22, 2020
@phaag phaag added the Feature request Feature request label Jan 15, 2023
@phaag
Copy link
Owner

phaag commented Oct 14, 2023

As go-nfdump can read nfdump binary files, a custom importer written in Go would be most efficient, I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants