Send Logs (OTLP/HTTP)
curl --request POST \
--url https://otel.logclaw.ai/v1/logs \
--header 'Content-Type: application/json' \
--header 'x-logclaw-api-key: <api-key>' \
--data '
{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-app"
}
}
]
},
"scopeLogs": [
{
"logRecords": [
{
"timeUnixNano": "1709312400000000000",
"severityText": "INFO",
"body": {
"stringValue": "Hello from LogClaw!"
}
}
]
}
]
}
]
}
'import requests
url = "https://otel.logclaw.ai/v1/logs"
payload = { "resourceLogs": [
{
"resource": { "attributes": [
{
"key": "service.name",
"value": { "stringValue": "my-app" }
}
] },
"scopeLogs": [{ "logRecords": [
{
"timeUnixNano": "1709312400000000000",
"severityText": "INFO",
"body": { "stringValue": "Hello from LogClaw!" }
}
] }]
}
] }
headers = {
"x-logclaw-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-logclaw-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resourceLogs: [
{
resource: {attributes: [{key: 'service.name', value: {stringValue: 'my-app'}}]},
scopeLogs: [
{
logRecords: [
{
timeUnixNano: '1709312400000000000',
severityText: 'INFO',
body: JSON.stringify({stringValue: 'Hello from LogClaw!'})
}
]
}
]
}
]
})
};
fetch('https://otel.logclaw.ai/v1/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://otel.logclaw.ai/v1/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceLogs' => [
[
'resource' => [
'attributes' => [
[
'key' => 'service.name',
'value' => [
'stringValue' => 'my-app'
]
]
]
],
'scopeLogs' => [
[
'logRecords' => [
[
'timeUnixNano' => '1709312400000000000',
'severityText' => 'INFO',
'body' => [
'stringValue' => 'Hello from LogClaw!'
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-logclaw-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://otel.logclaw.ai/v1/logs"
payload := strings.NewReader("{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-logclaw-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://otel.logclaw.ai/v1/logs")
.header("x-logclaw-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otel.logclaw.ai/v1/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-logclaw-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"partialSuccess": {}
}{
"error": "Missing x-logclaw-api-key header"
}{
"error": "Failed to forward request to OTel Collector"
}Ingestion
Send Logs
Ingest log records in OTLP HTTP/JSON format. This is the primary ingestion endpoint for LogClaw Cloud. Logs are processed through the pipeline: OTel Collector → Kafka → Bridge → OpenSearch.
The auth proxy automatically injects your project’s tenant_id into each
log record based on your API key.
POST
/
v1
/
logs
Send Logs (OTLP/HTTP)
curl --request POST \
--url https://otel.logclaw.ai/v1/logs \
--header 'Content-Type: application/json' \
--header 'x-logclaw-api-key: <api-key>' \
--data '
{
"resourceLogs": [
{
"resource": {
"attributes": [
{
"key": "service.name",
"value": {
"stringValue": "my-app"
}
}
]
},
"scopeLogs": [
{
"logRecords": [
{
"timeUnixNano": "1709312400000000000",
"severityText": "INFO",
"body": {
"stringValue": "Hello from LogClaw!"
}
}
]
}
]
}
]
}
'import requests
url = "https://otel.logclaw.ai/v1/logs"
payload = { "resourceLogs": [
{
"resource": { "attributes": [
{
"key": "service.name",
"value": { "stringValue": "my-app" }
}
] },
"scopeLogs": [{ "logRecords": [
{
"timeUnixNano": "1709312400000000000",
"severityText": "INFO",
"body": { "stringValue": "Hello from LogClaw!" }
}
] }]
}
] }
headers = {
"x-logclaw-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-logclaw-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resourceLogs: [
{
resource: {attributes: [{key: 'service.name', value: {stringValue: 'my-app'}}]},
scopeLogs: [
{
logRecords: [
{
timeUnixNano: '1709312400000000000',
severityText: 'INFO',
body: JSON.stringify({stringValue: 'Hello from LogClaw!'})
}
]
}
]
}
]
})
};
fetch('https://otel.logclaw.ai/v1/logs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://otel.logclaw.ai/v1/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resourceLogs' => [
[
'resource' => [
'attributes' => [
[
'key' => 'service.name',
'value' => [
'stringValue' => 'my-app'
]
]
]
],
'scopeLogs' => [
[
'logRecords' => [
[
'timeUnixNano' => '1709312400000000000',
'severityText' => 'INFO',
'body' => [
'stringValue' => 'Hello from LogClaw!'
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-logclaw-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://otel.logclaw.ai/v1/logs"
payload := strings.NewReader("{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-logclaw-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://otel.logclaw.ai/v1/logs")
.header("x-logclaw-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://otel.logclaw.ai/v1/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-logclaw-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resourceLogs\": [\n {\n \"resource\": {\n \"attributes\": [\n {\n \"key\": \"service.name\",\n \"value\": {\n \"stringValue\": \"my-app\"\n }\n }\n ]\n },\n \"scopeLogs\": [\n {\n \"logRecords\": [\n {\n \"timeUnixNano\": \"1709312400000000000\",\n \"severityText\": \"INFO\",\n \"body\": {\n \"stringValue\": \"Hello from LogClaw!\"\n }\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"partialSuccess": {}
}{
"error": "Missing x-logclaw-api-key header"
}{
"error": "Failed to forward request to OTel Collector"
}⌘I