Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save naumvd95/e525f36bc1348bfab28ac09d47ecffee to your computer and use it in GitHub Desktop.
Save naumvd95/e525f36bc1348bfab28ac09d47ecffee to your computer and use it in GitHub Desktop.
Pushkin elastic fake notification generator
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