This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sostat: output when no packet drops for Suricata
- Loading branch information
1 parent
46deced
commit b63e3d9
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,8 +112,15 @@ if [ -d /nsm/sensor_data ]; then | |
if [ "$ENGINE" = "suricata" ]; then | ||
for i in /nsm/sensor_data/*/stats.log; do | ||
echo "$i" | ||
tail -n 50 "$i" | grep -e "Date: " -e "drop" | ||
echo | ||
if [ $( tail -n 50 $i | grep -c drop $i) -ne 0 ]; then | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
weslambert
via email
Author
Contributor
|
||
echo | ||
tail -n 50 "$i" | grep -e "Date: " -e "drop" | ||
echo | ||
else | ||
echo | ||
echo "No packet drops reported." | ||
echo | ||
fi | ||
done | ||
else | ||
for i in /nsm/sensor_data/*/snort-*.stats; do | ||
|
@@ -125,7 +132,6 @@ if [ -d /nsm/sensor_data ]; then | |
fi | ||
done | ||
fi | ||
echo | ||
echo "-------------------------------------------------------------------------" | ||
echo | ||
TMP=`mktemp` | ||
|
It looks like we take the last 50 lines of the stats.log ($i) and pipe that into a grep of the same file. Is that correct?