Skip to content

Instantly share code, notes, and snippets.

@jrobinsonc
Last active April 14, 2020 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrobinsonc/e0c9f3c104cddb00d476184b19a4cdbe to your computer and use it in GitHub Desktop.
Save jrobinsonc/e0c9f3c104cddb00d476184b19a4cdbe to your computer and use it in GitHub Desktop.
#!/bin/bash
# Usage
# ./logzio <type> <message>
# ./logzio info "My Message"
LOG=$2
TYPE=$1
ENV=PRO # Useful to identify which env is sending the log
TOKEN=XXX...
ENDPOINT=listener.logz.io:8071
curl \
-H "Content-Type:application/json" \
-X POST -d "{\"message\":\"$LOG\",\"message_type\":\"$TYPE\"}" \
"https://$ENDPOINT/?token=$TOKEN&type=$ENV" 2>/dev/null 1>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment