mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
26 lines
530 B
Bash
26 lines
530 B
Bash
#!/bin/bash
|
|
|
|
PREVCOUNTFILE='/tmp/helixevents.txt'
|
|
EVENTCOUNTCURRENT="$(curl -s localhost:9600/_node/stats | jq '.pipelines.helix.events.out')"
|
|
|
|
if [ ! -z "$EVENTCOUNTCURRENT" ]; then
|
|
|
|
if [ -f "$PREVCOUNTFILE" ]; then
|
|
EVENTCOUNTPREVIOUS=`cat $PREVCOUNTFILE`
|
|
else
|
|
echo "${EVENTCOUNTCURRENT}" > $PREVCOUNTFILE
|
|
exit 0
|
|
fi
|
|
|
|
echo "${EVENTCOUNTCURRENT}" > $PREVCOUNTFILE
|
|
EVENTS=$((EVENTCOUNTCURRENT - EVENTCOUNTPREVIOUS))
|
|
if [ "$EVENTS" -lt 0 ]; then
|
|
EVENTS=0
|
|
fi
|
|
|
|
echo "helixeps eps=${EVENTS}"
|
|
|
|
fi
|
|
|
|
exit 0
|