Merge pull request #8768 from Security-Onion-Solutions/config

refactor sostatus telegraf input script
This commit is contained in:
Jason Ertel
2022-09-19 10:35:22 -04:00
committed by GitHub

View File

@@ -11,12 +11,11 @@
if [[ ! "`pidof -x $(basename $0) -o %PPID`" ]]; then
SOSTATUSLOG=/var/log/sostatus/status.log
SOSTATUSCODE=$(jq -r .status_code /var/log/sostatus/status.log)
SOSTATUSJSON=$(cat /var/log/sostatus/status.log)
SOSTATUSCODE=$(jq -r .status_code $SOSTATUSLOG)
SOSTATUSJSON=$(cat $SOSTATUSLOG | sed 's/"/\\"/g')
if [ -f "$SOSTATUSLOG" ]; then
echo "sostatus status=$SOSTATUSCODE"
echo "sostatus json=$SOSTATUSJSON"
echo "sostatus status=$SOSTATUSCODE,json=\"$SOSTATUSJSON\""
else
exit 0
fi