-
-
Save naumvd95/e525f36bc1348bfab28ac09d47ecffee to your computer and use it in GitHub Desktop.
Pushkin elastic fake notification generator
This file contains 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
host=172.16.10.254 | |
port=9200 | |
title=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=2))") | |
content=$(python -c "import random_words; print ' '.join(random_words.RandomWords().random_words(count=10))") | |
app=$(($RANDOM % 3 + 1)) | |
timestamp=$(date +"%Y-%m-%d %H:%M:%S") | |
data=" | |
\"title\": \"${title}\", | |
\"content\": \"${content}\", | |
\"applicationId\": ${app}, | |
\"level\": \"WARNING\", | |
\"read\": false, | |
\"timestamp\": \"${timestamp}\" | |
" | |
curl -svv -XPOST "http://$host:$port/notifications/notification?pretty&pretty" -H 'Content-Type: application/json' -d "{${data}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment