init III
This commit is contained in:
38
Linux remote_logger/sender.sh
Normal file
38
Linux remote_logger/sender.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
ID=10101011
|
||||
STREAM=$1
|
||||
IP=10.101.0.12
|
||||
PORT=34567
|
||||
GREP=$2
|
||||
echo $GREP
|
||||
FILTER=$3
|
||||
|
||||
cd /syslog
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
echo "
|
||||
Filter Device $FILTER and egrep case insensitive for $GREP
|
||||
Send result to $IP:$PORT
|
||||
My ID $ID and Stream $STREAM
|
||||
"
|
||||
|
||||
echo " 2020-20-20T20:20:20+20 filter@$ID filter=\"test\" grep=\"test\" stream@$ID stream=\"test\"] testmessage" | logger --rfc5424 -n $IP --id=34567 -T -P $PORT
|
||||
|
||||
if [ "$FILTER" == "" ]
|
||||
then
|
||||
tail -f *.log | egrep -i $GREP | logger --rfc5424 -n $IP --id=34567 -T -P $PORT \
|
||||
--sd-id filter@$ID \
|
||||
--sd-param filter=\"none\" \
|
||||
--sd-param grep=\"$GREP\" \
|
||||
--sd-id stream@$ID \
|
||||
--sd-param stream=\"$STREAM\"
|
||||
else
|
||||
tail -f * | /syslog/filter $FILTER | egrep -i $GREP | logger --rfc5424 -n $IP --id=34567 -T -P $PORT \
|
||||
--sd-id filter@$ID \
|
||||
--sd-param filter=\"$FILTER\" \
|
||||
--sd-param grep=\"$GREP\" \
|
||||
--sd-id stream@$ID \
|
||||
--sd-param stream=\"$STREAM\"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user