Last active
April 7, 2017 12:41
-
-
Save rkhozinov/b1c72488f070de99cdad8a84679a80f2 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
# https://pypi.python.org/pypi/RandomWords/0.1.5 | |
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 -XDELETE http://$host:$port/_all | |
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