Skip to main content
POST
/
v0
/
metrics
/
logs
/
query
Query logs with flexible filters
curl --request POST \
  --url https://controller.platform.simplecloud.app/v0/metrics/logs/query \
  --header 'Content-Type: application/json' \
  --header 'X-Network-ID: <x-network-id>' \
  --header 'X-Network-Secret: <x-network-secret>' \
  --data '
{
  "cursor": "<string>",
  "from": "<string>",
  "limit": 123,
  "order": "<string>",
  "persistent_server_ids": [
    "<string>"
  ],
  "search": "<string>",
  "server_group_ids": [
    "<string>"
  ],
  "server_ids": [
    "<string>"
  ],
  "serverhost_ids": [
    "<string>"
  ],
  "severities": [
    "<string>"
  ],
  "tags": [
    "<string>"
  ],
  "to": "<string>"
}
'
import requests

url = "https://controller.platform.simplecloud.app/v0/metrics/logs/query"

payload = {
    "cursor": "<string>",
    "from": "<string>",
    "limit": 123,
    "order": "<string>",
    "persistent_server_ids": ["<string>"],
    "search": "<string>",
    "server_group_ids": ["<string>"],
    "server_ids": ["<string>"],
    "serverhost_ids": ["<string>"],
    "severities": ["<string>"],
    "tags": ["<string>"],
    "to": "<string>"
}
headers = {
    "X-Network-ID": "<x-network-id>",
    "X-Network-Secret": "<x-network-secret>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'X-Network-ID': '<x-network-id>',
    'X-Network-Secret': '<x-network-secret>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    cursor: '<string>',
    from: '<string>',
    limit: 123,
    order: '<string>',
    persistent_server_ids: ['<string>'],
    search: '<string>',
    server_group_ids: ['<string>'],
    server_ids: ['<string>'],
    serverhost_ids: ['<string>'],
    severities: ['<string>'],
    tags: ['<string>'],
    to: '<string>'
  })
};

fetch('https://controller.platform.simplecloud.app/v0/metrics/logs/query', 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://controller.platform.simplecloud.app/v0/metrics/logs/query",
  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([
    'cursor' => '<string>',
    'from' => '<string>',
    'limit' => 123,
    'order' => '<string>',
    'persistent_server_ids' => [
        '<string>'
    ],
    'search' => '<string>',
    'server_group_ids' => [
        '<string>'
    ],
    'server_ids' => [
        '<string>'
    ],
    'serverhost_ids' => [
        '<string>'
    ],
    'severities' => [
        '<string>'
    ],
    'tags' => [
        '<string>'
    ],
    'to' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "X-Network-ID: <x-network-id>",
    "X-Network-Secret: <x-network-secret>"
  ],
]);

$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://controller.platform.simplecloud.app/v0/metrics/logs/query"

	payload := strings.NewReader("{\n  \"cursor\": \"<string>\",\n  \"from\": \"<string>\",\n  \"limit\": 123,\n  \"order\": \"<string>\",\n  \"persistent_server_ids\": [\n    \"<string>\"\n  ],\n  \"search\": \"<string>\",\n  \"server_group_ids\": [\n    \"<string>\"\n  ],\n  \"server_ids\": [\n    \"<string>\"\n  ],\n  \"serverhost_ids\": [\n    \"<string>\"\n  ],\n  \"severities\": [\n    \"<string>\"\n  ],\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"to\": \"<string>\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-Network-ID", "<x-network-id>")
	req.Header.Add("X-Network-Secret", "<x-network-secret>")
	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://controller.platform.simplecloud.app/v0/metrics/logs/query")
  .header("X-Network-ID", "<x-network-id>")
  .header("X-Network-Secret", "<x-network-secret>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cursor\": \"<string>\",\n  \"from\": \"<string>\",\n  \"limit\": 123,\n  \"order\": \"<string>\",\n  \"persistent_server_ids\": [\n    \"<string>\"\n  ],\n  \"search\": \"<string>\",\n  \"server_group_ids\": [\n    \"<string>\"\n  ],\n  \"server_ids\": [\n    \"<string>\"\n  ],\n  \"serverhost_ids\": [\n    \"<string>\"\n  ],\n  \"severities\": [\n    \"<string>\"\n  ],\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"to\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://controller.platform.simplecloud.app/v0/metrics/logs/query")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Network-ID"] = '<x-network-id>'
request["X-Network-Secret"] = '<x-network-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cursor\": \"<string>\",\n  \"from\": \"<string>\",\n  \"limit\": 123,\n  \"order\": \"<string>\",\n  \"persistent_server_ids\": [\n    \"<string>\"\n  ],\n  \"search\": \"<string>\",\n  \"server_group_ids\": [\n    \"<string>\"\n  ],\n  \"server_ids\": [\n    \"<string>\"\n  ],\n  \"serverhost_ids\": [\n    \"<string>\"\n  ],\n  \"severities\": [\n    \"<string>\"\n  ],\n  \"tags\": [\n    \"<string>\"\n  ],\n  \"to\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "cursor": "<string>",
  "has_more": true,
  "logs": [
    {
      "message": "<string>",
      "numerical_id": 123,
      "persistent_server_id": "<string>",
      "persistent_server_name": "<string>",
      "sequence": 123,
      "server_group_id": "<string>",
      "server_group_name": "<string>",
      "server_id": "<string>",
      "server_name": "<string>",
      "server_type": "<string>",
      "serverhost_id": "<string>",
      "serverhost_name": "<string>",
      "severity": "<string>",
      "tags": [
        "<string>"
      ],
      "timestamp": "<string>",
      "trace_id": "<string>"
    }
  ]
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}

Headers

X-Network-ID
string
required

Network ID

X-Network-Secret
string
required

Network Secret

Body

application/json

Query filters

cursor
string
from
string
limit
integer
order
string
persistent_server_ids
string[]
server_group_ids
string[]
server_ids
string[]
serverhost_ids
string[]
severities
string[]
tags
string[]
to
string

Response

OK

cursor
string
has_more
boolean
logs
object[]