Created
December 22, 2021 13:07
-
-
Save chasers/f34c94ac611ab95e4b4282ee149b5d87 to your computer and use it in GitHub Desktop.
Send Logflare log event batches with an API request
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
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