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

Handle nil suricata event_stats #8389

Closed
alexolivan opened this issue May 10, 2024 · 2 comments
Closed

Handle nil suricata event_stats #8389

alexolivan opened this issue May 10, 2024 · 2 comments
Assignees
Labels
Bug Ready to Test a feedback is needed on a proposal or implementation

Comments

@alexolivan
Copy link

alexolivan commented May 10, 2024

What would you like to add or change?:
Handle eventual nit event_stats value on suricata.lua script (line 157)

   external_stats.signatures_loaded = 0
   external_stats.signatures_failed = 0

   if event_stats ~= nil then
      external_stats.capture_packets = 0
      external_stats.capture_drops = 0
   else
      external_stats.capture_packets = (event_stats.capture.kernel_packets - event_stats.capture.kernel_drops)
      external_stats.capture_drops = event_stats.capture.kernel_drops

      for _, engine in ipairs(event_stats.detect.engines) do
         external_stats.signatures_loaded = external_stats.signatures_loaded + engine.rules_loaded
         external_stats.signatures_failed = external_stats.signatures_failed + engine.rules_failed
      end
   end

Why do you and others need this?:
Log gets quite an amount of 'noise' due to this script failing from time to time

lucaderi added a commit that referenced this issue May 10, 2024
@lucaderi
Copy link
Member

This is odd. I have added an extra check but I am not sure it helps. Please update to the new version (packages will be built in about 1h from now and report)

@cardigliano cardigliano added the Ready to Test a feedback is needed on a proposal or implementation label May 27, 2024
@cardigliano
Copy link
Member

Closing (no feedback, likely fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Ready to Test a feedback is needed on a proposal or implementation
Projects
None yet
Development

No branches or pull requests

4 participants