Shell

LogHive provides a simple REST API that you can use to push events and errors. Here is an example code for Shell:

Push Event

#!/bin/bash

url="https://api.loghive.app/v1/event/add"
content_type="Content-Type: application/json"
authorization="ApiKey: YourPersonalApiKey"
body="{\"project\":\"yourprojectname\", \"group\":\"yourgroupname\",\"event\":\"your-event-name\",\"description\":\"your-description\",\"notify\":false}"

curl -X POST -H "$content_type" -H "$authorization" -d "$body" "$url"

Push Insight

#!/bin/bash

url="https://api.loghive.app/v1/insight/add"
content_type="Content-Type: application/json"
authorization="ApiKey: YourPersonalApiKey"
body="{\"project\":\"MySaas\", \"insight\":\"system1-online\",\"value\":1}"

curl -X POST -H "$content_type" -H "$authorization" -d "$body" "$url"

Last updated