Skip to content

Instantly share code, notes, and snippets.

@ssoto
Created June 24, 2015 14:01
Show Gist options
  • Save ssoto/7ebd05e85c5f6ae223e9 to your computer and use it in GitHub Desktop.
Save ssoto/7ebd05e85c5f6ae223e9 to your computer and use it in GitHub Desktop.
Random syslog message sent each random seconds
#!/bin/bash
POS=2
LEN=16
SECONDS_MAX=10
while true; do
str1=$( echo -n `date +\"%s\"` | md5sum | md5sum )
randstring="${str1:$POS:$LEN}"
logger -t "kafka-test" Random message "$randstring"
RANDOM_SEC=`shuf -i 1-$SECONDS_MAX -n 1`
sleep $RANDOM_SEC
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment