Skip to content

Commit

Permalink
remove echos
Browse files Browse the repository at this point in the history
  • Loading branch information
ofer-velich committed Jan 6, 2016
1 parent 93fe33a commit 293e132
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Binary file modified dist/logzio-rsyslog.tar.gz
Binary file not shown.
12 changes: 2 additions & 10 deletions rsyslog/plugins/mysqlerror_rsyslog_plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,22 @@
TOKEN=$1
TYPE=$2
LOG_LINE=""
echo "TOKEN IS $TOKEN and TYPE IS $TYPE"

while read line
do

regex='^([0-9][0-9][0-9][0-9][0-9][0-9]\s+?([0-9])*[0-9]:[0-9][0-9]:[0-9][0-9]|[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\s+?([0-9])*[0-9]:[0-9][0-9]:[0-9][0-9]).*'

echo "loop start $line"

if [[ $LOG_LINE == "" ]]; then
echo "loop first catch"
LOG_LINE=$(echo $line)
else
echo "loop adding"

LOG_LINE=$(echo $LOG_LINE LOGZIO_LF $line)
fi

if [[ $line =~ $regex ]]; then

LOG_LINE=$(echo $line)
echo "[$TOKEN][type=$TYPE]$LOG_LINE"
LOG_LINE=$(echo $line)
echo "[$TOKEN][type=$TYPE]$LOG_LINE" | nc listener.logz.io 8010
fi

echo "loop end"

done < /dev/stdin

0 comments on commit 293e132

Please sign in to comment.