Skip to content

Instantly share code, notes, and snippets.

@chasers
Created December 22, 2021 13:07
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 chasers/f34c94ac611ab95e4b4282ee149b5d87 to your computer and use it in GitHub Desktop.
Save chasers/f34c94ac611ab95e4b4282ee149b5d87 to your computer and use it in GitHub Desktop.
Send Logflare log event batches with an API request
curl -X "POST" "https://api.logflare.app/api/logs?source=YOUR_SOURCE_UUID" \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: YOUR_INGEST_API_KEY' \
-d $'{
"batch": [
{
"message": "A human readable event message!",
"metadata": {
"ip_address": "1.2.3.4",
"datacenter": "aws",
"custom_user_data": {
"vip": true,
"id": 12,
"login_count": 45
}
}
},
{
"message": "Another human readable event message!",
"metadata": {
"ip_address": "1.2.3.4",
"datacenter": "aws",
"custom_user_data": {
"vip": true,
"id": 12,
"login_count": 45
}
}
}
]
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment