HTTP/S
Ship logs using HTTP/S to your Logit.io Stack
Follow the steps below to send your observability data to Logit.io
Logs
Send HTTP/S logs to your Logit.io Stack via Logstash.
Install Integration
Please click on the Install Integration button to configure your stack for this source.
Requirements
- Valid JSON content
- API key, sent in the headers. If you are logged into your Logit.io account the API key and endpoint should be automatically populated in the examples below.
- Content-Type header set as application/json
- Either POST or PUT to https://@logitApiEndpoint/v2
Example
Remember that you will need to escape double-quote characters with a backslash in the data field as shown in the example below:
CMD
curl -i -H "ApiKey: @apikey" -i -H "Content-Type: application/json" -H "LogType: json" https://@logitApiEndpoint/v2 -d "{\"test\":\"test\",\"example\": { \"a\": 1, \"b\": 2 } }"
Powershell
curl -Method Post `
-Uri "https://@logitApiEndpoint/v2" `
-Headers @{
"ApiKey" = "@apikey";
"Content-Type" = "application/json";
"LogType" = "json"
} `
-Body (@{
test = "test";
example = @{
a = 1;
b = 2
}
} | ConvertTo-Json)
Response
You should expect to receive a 202 ACCEPTED response code for a successful message
HTTP/1.1 202 ACCEPTED
Content-Type: application/json
Content-Length: 39
Connection: keep-alive
Server: Logit-API-Server
Date: Wed, 27 Mar 2024 14:34:39 GMT
Access-Control-Allow-Origin: *
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Xss-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
{"message":"Message Received, Thanks"}
Launch Logs to View Your Data
Launch LogsHow to diagnose no data in Stack
If you don't see data appearing in your stack after following this integration, take a look at the troubleshooting guide for steps to diagnose and resolve the problem or contact our support team and we'll be happy to assist.