Hello Monks,

I am logging alerts with Snort and making output files of them. I am wondering if there was a way for Perl to read that data continuously so I would never have to turn off Snort and have it keep logging to one file. I know there is a File::Tail but I do not think this works for binary, only for ascii.

Either Perl could parse as new alerts are writing to the output file or another option is rolling over the files every time Snort realizes there are x MB of data in them. Then Perl can parse a file xxx.log and change it to xxy.log, while there are files that are not xxy.log, then parse them.

Which option do you think is the most feasible?


In reply to Parsing Snort Binary Files by ahuang14

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.