Alert vs. log in the Snort /var/log/snort directory

Alert vs. log in the Snort /var/log/snort directory

Your article, "Improving Snort with Barnyard," was nice but i noticed two things. I have used Snort and Barnyard together for a while and there is some stuff Sourcefire never had the answer to. Maybe you can help. What is the difference between the "log" log and the alert logs that show up in the /var/log/snort directory? I was told by some people you don't need the alert log; the "log" log has everything that alert has and more. Anyways, it is awfully confusing and it seems that Barnyard only processes the /var/log/snort/*.log files and not the *.alert.

    Requires Free Membership to View

    When you register, my team of editors will also send you resources covering Linux administration and management; integration and interoperability between Linux, Windows and Unix; securing Linux and mixed-platform environments; and migrating to Linux.

    Cathleen A. Gagne, Senior Editorial Director

    By submitting your registration information to SearchEnterpriseLinux.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchEnterpriseLinux.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

This is an interesting question. The difference between alert and log comes down to how you write your rules. Rules can have actions associated with them when they trigger. The possible actions are, to quote the Snort manual:

  • alert -- generate an alert using the selected alert method, and then log the packet
  • log -- log the packet
  • pass -- ignore the packet
  • activate -- alert and then turn on another dynamic rule
  • dynamic -- remain idle until activated by an activate rule, then act as a log rule

If a rule is configured to alert, then an alert will be generated and outputted to whatever alert method you have configured, like a file in /var/log/snort. The packet is then logged to your log output method; for example, the snort*.log files. So by processing the log files, you will get all of the entries. The best and clearest answer to this question, however, comes from Marty Roesch himself in this 2002 mailing list post.

This was first published in June 2007