farsightsec / fstrm

Frame Streams implementation in C
MIT License
59 stars 27 forks source link

fstrm_capture and outputing to stdout #9

Closed adulau closed 8 years ago

adulau commented 9 years ago

I have a small question regarding fstrm_capture and its use with dnstap. I was wondering why the default mode for fstrm_capture is to dump the output on a file and not to use stdout.

To be able to do stuff like this:

fstrm_capture  -t protobuf:dnstap.Dnstap -u /tmp/dnstap.sock -w - -ddddd | ..git/dnstap-ldns/dnstap-ldns -r -

Is there a specific reason to not to do so? I was close to patch it but not sure if this is really a good idea.

Thanks a lot.

edmonds commented 9 years ago

Hi, Alexandre:

No real reason, just an oversight. If you have a patch please send it :-)

The only thing I'd insist on is to call isatty(STDOUT_FILENO); or similar and refuse to write to stdout if it's a terminal, since the Frame Streams output is binary.

adulau commented 9 years ago

Thank you Robert. I'll do a patch.

edmonds commented 9 years ago

BTW, thanks for testing out dnstap! If you run into any issues feel free to also contact me directly (edmonds@fsi.io) if necessary or via the dnstap mailing list (http://lists.redbarn.org/mailman/listinfo/dnstap).

Also, if you're testing fstrm/dnstap with Unbound, I'm currently tracking down a crashing bug reported by a user, you may need to apply a patch (https://unbound.nlnetlabs.nl/pipermail/unbound-users/2015-April/003859.html).

sjm42 commented 8 years ago

I accidentally did this here: https://github.com/farsightsec/fstrm/pull/15

bapril commented 8 years ago

Closing this , the code is merged into Next. working on a release now.