Last active
December 19, 2017 01:32
-
-
Save idlethreat/2ec5961b0d904a9d6c16425881eca49e to your computer and use it in GitHub Desktop.
Graylog Message Sender
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# set your sleep in seconds. remove the sleep line to have no sleep | |
SLEEP="1" | |
# ip of your graylog server | |
GRAYLOG="192.168.1.1" | |
# loripsum.net API URL | |
LORIPSUM="https://loripsum.net/api/1/long/plaintext" | |
while : | |
do | |
MESSAGE=$(curl -s $LORIPSUM) | |
echo '{"version": "1.1","host":"example.org","short_message":"A short message that helps you identify what is going on","full_message":"'$MESSAGE'","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}' | gzip | nc -u -w 1 $GRAYLOG 12201 | |
sleep $SLEEP # comment this out if you want to sleep | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment