Endurance

Log endpoints

Updated

Journal

List the journal servers

GET /logs/servers/journal

curl
curl -X GET "https://appliance.example.com/api/v1/logs/servers/journal" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/journal';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/logs/servers/journal", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/journal', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the journal servers
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/journal
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Journal Server/s",
  "data": [
    {
      "id": "6e7-d6e-326-f29",
      "protocol": "http",
      "ipDomain": "100.100.100.100",
      "port": 514
    }
  ]
}

Add Journal Server

POST /logs/servers/journal

This change is staged. Send PUT /services/apply to apply it.

Body parameters
protocol string Required

Journal Protocol (http, https)

ipDomain string Required

Journal IP/Domain

port integer Required

Journal Port

curl
curl -X POST "https://appliance.example.com/api/v1/logs/servers/journal" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/journal';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'protocol' => '<protocol>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0
}

response = requests.post("https://appliance.example.com/api/v1/logs/servers/journal", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/journal', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a journal server
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/journal
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0
  }
}
Response
{
  "status": "success",
  "message": "Journal Server added",
  "data": {
    "id": "5ca-35d-687-c1f"
  }
}

Journal by ID

Get Journal Server By ID

GET /logs/servers/journal/{id}

Path parameters
id string Required

Journal Server ID

curl
curl -X GET "https://appliance.example.com/api/v1/logs/servers/journal/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/journal/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/logs/servers/journal/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/journal/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a journal server
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/journal/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Journal Server",
  "data": {
    "id": "6e7-d6e-326-f29",
    "protocol": "http",
    "ipDomain": "100.100.100.100",
    "port": 514
  }
}

Edit a Journal Server

PUT /logs/servers/journal/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Journal Server ID

Body parameters
protocol string Required

Journal Protocol (http, https)

ipDomain string Required

Journal IP/Domain

port integer Required

Journal Port

curl
curl -X PUT "https://appliance.example.com/api/v1/logs/servers/journal/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/journal/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'protocol' => '<protocol>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0
}

response = requests.put("https://appliance.example.com/api/v1/logs/servers/journal/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/journal/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a journal server
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/journal/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0
  }
}
Response
{
  "status": "success",
  "message": "Journal Server edited",
  "data": {
    "id": "5ca-35d-687-7c1"
  }
}

Delete Journal Server

DELETE /logs/servers/journal/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Journal Server ID

curl
curl -X DELETE "https://appliance.example.com/api/v1/logs/servers/journal/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/journal/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/logs/servers/journal/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/journal/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a journal server
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/journal/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Journal Server deleted"
}

Syslog

List the syslog servers

GET /logs/servers/syslog

curl
curl -X GET "https://appliance.example.com/api/v1/logs/servers/syslog" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/syslog';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/logs/servers/syslog", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/syslog', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the syslog servers
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/syslog
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Syslog Server/s",
  "data": [
    {
      "id": "6e7-d6e-326-f29",
      "protocol": "udp",
      "ipDomain": "100.100.100.100",
      "port": 514,
      "token": "",
      "caId": ""
    },
    {
      "id": "5ca-35d-687-c1f",
      "protocol": "tls",
      "ipDomain": "collectors.example.com",
      "port": 6514,
      "token": "",
      "caId": "ca-123"
    }
  ]
}

Add Syslog Server

POST /logs/servers/syslog

This change is staged. Send PUT /services/apply to apply it.

Body parameters
protocol string Required

Syslog Protocol (udp, tcp, tls)

ipDomain string Required

Syslog IP/Domain

port integer Required

Syslog Port

token string

Collector token, sent in the RFC 5424 structured data (tls only). A secret: never returned, so GET always reads an empty string.

caId string

Certs-module CA id to trust for TLS (tls only; else system CA bundle)

curl
curl -X POST "https://appliance.example.com/api/v1/logs/servers/syslog" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "token": "<token>",
  "caId": "<caId>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/syslog';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'protocol' => '<protocol>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
    'token' => '<token>',
    'caId' => '<caId>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "token": "<token>",
    "caId": "<caId>"
}

response = requests.post("https://appliance.example.com/api/v1/logs/servers/syslog", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/syslog', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "token": "<token>",
  "caId": "<caId>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Create a syslog server
  type: http
  seq: 1
}

post {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/syslog
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "token": "<token>",
    "caId": "<caId>"
  }
}
Response
{
  "status": "success",
  "message": "Syslog Server added",
  "data": {
    "id": "5ca-35d-687-c1f"
  }
}

Syslog by ID

Get Syslog Server By ID

GET /logs/servers/syslog/{id}

Path parameters
id string Required

Syslog Server ID

curl
curl -X GET "https://appliance.example.com/api/v1/logs/servers/syslog/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/syslog/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/logs/servers/syslog/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/syslog/{id}', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get a syslog server
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/syslog/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Syslog Server",
  "data": {
    "id": "6e7-d6e-326-f29",
    "protocol": "tls",
    "ipDomain": "collectors.example.com",
    "port": 6514,
    "token": "",
    "caId": "ca-123"
  }
}

Edit a Syslog Server

PUT /logs/servers/syslog/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Syslog Server ID

Body parameters
protocol string Required

Syslog Protocol (udp, tcp, tls)

ipDomain string Required

Syslog IP/Domain

port integer Required

Syslog Port

token string

Collector token (tls only). A secret: never returned, so GET always reads an empty string. Leave it out to keep the stored token; an empty string clears it.

caId string

Certs-module CA id to trust for TLS (tls only; else system CA bundle)

curl
curl -X PUT "https://appliance.example.com/api/v1/logs/servers/syslog/{id}" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "token": "<token>",
  "caId": "<caId>"
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/syslog/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'protocol' => '<protocol>',
    'ipDomain' => '<ipDomain>',
    'port' => 0,
    'token' => '<token>',
    'caId' => '<caId>',
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "token": "<token>",
    "caId": "<caId>"
}

response = requests.put("https://appliance.example.com/api/v1/logs/servers/syslog/{id}", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/syslog/{id}', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "protocol": "<protocol>",
  "ipDomain": "<ipDomain>",
  "port": 0,
  "token": "<token>",
  "caId": "<caId>"
}),
});

const data = await response.json();
Bruno
meta {
  name: Update a syslog server
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/syslog/{id}
  body: json
  auth: bearer
}

headers {
  Content-Type: application/json
}

auth:bearer {
  token: {{token}}
}

body:json {
  {
    "protocol": "<protocol>",
    "ipDomain": "<ipDomain>",
    "port": 0,
    "token": "<token>",
    "caId": "<caId>"
  }
}
Response
{
  "status": "success",
  "message": "Syslog Server edited",
  "data": {
    "id": "5ca-35d-687-7c1"
  }
}

Delete Syslog Server

DELETE /logs/servers/syslog/{id}

This change is staged. Send PUT /services/apply to apply it.

Path parameters
id string Required

Syslog Server ID

curl
curl -X DELETE "https://appliance.example.com/api/v1/logs/servers/syslog/{id}" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/servers/syslog/{id}';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.delete("https://appliance.example.com/api/v1/logs/servers/syslog/{id}", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/servers/syslog/{id}', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Delete a syslog server
  type: http
  seq: 1
}

delete {
  url: https://{{node-0}}:{{port}}/api/v1/logs/servers/syslog/{id}
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Syslog Server deleted"
}

Settings

Get Logs settings

GET /logs/settings

curl
curl -X GET "https://appliance.example.com/api/v1/logs/settings" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/settings';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/logs/settings", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/settings', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Get the logging settings
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/logs/settings
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Journal Setting",
  "data": {
    "maxUseGBytes": 30,
    "maxFileSizeMBytes": 500,
    "maxFiles": 61,
    "keepFreeGBytes": 1,
    "maxRetentionSecWeeks": 26
  }
}

Update Logs settings

PUT /logs/settings

This change is staged. Send PUT /services/apply to apply it.

curl
curl -X PUT "https://appliance.example.com/api/v1/logs/settings" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/logs/settings';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.put("https://appliance.example.com/api/v1/logs/settings", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/logs/settings', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Update the logging settings
  type: http
  seq: 1
}

put {
  url: https://{{node-0}}:{{port}}/api/v1/logs/settings
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Journal settings updated"
}

Read the appliance logs

Read the journal entries inside a time window, from since to until (or now, whichever is earlier), at most lines of them. By default the read takes the newest entries of the window (direction=newest); direction=oldest takes the oldest, from the window’s start. more says the window held more entries than were returned: on a newest read, older ones, which a read with an earlier until returns; on an oldest read, newer ones. To read on to newer entries with no gaps or repeats — to refresh, or to page an oldest read — send the response’s cursor as after, and the next read the cursor that returns; with nothing new it returns the same cursor. An after cursor must name an entry still in this appliance’s journal. Entries dated more than a minute in the future, written while the clock was ahead, are never inside a window that ends now; futureEntries says the journal holds some. start/end are the times of the entries returned, first/last those of the entries at the journal’s head and end: the first and last written, which are not always the earliest and latest dated.

GET /{applianceId}/logs

Path parameters
applianceId string Required

The id of the cluster node the request is for.

Query parameters
services array of string

Return only entries from these services, as listed by /logs/services. A daemon (group service) matches every entry its systemd unit wrote, whatever its process is called — rsyslogd for rsyslog, php for lb-websocket — including the commands it ran with sudo (each row’s unit says which). Any name also matches what its process logged before it started, which the journal records as a bracketed name such as (cheduler). Omit for every service.

lines integer default: "1000"

The most entries to return.

since string

format YYYY-MM-DD HH:MM:SS

until string

format YYYY-MM-DD HH:MM:SS

reverse boolean default: "false"

List the entries returned newest first. Which entries are returned does not change.

direction default: "newest" newest | oldest

Which end of the window to take entries from when it holds more than lines: newest (the default) or oldest. A read with after reads oldest first: omit direction or send oldest, as newest is refused.

after string

The cursor of a previous read: return the entries after it, oldest first, still inside the window. It must name an entry still in this appliance’s journal.

levels array of string

Return only entries at these Log Levels. The journal’s PRIORITY 0-3 is error, 4 warning, and 5-7 or none info. Omit for every level.

curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/logs" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/logs';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/{applianceId}/logs", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/logs', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: Read the appliance logs
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/logs
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Logs",
  "data": {
    "logs": [
      {
        "datetime": "2022-01-04 14:14:52",
        "uid": 0,
        "gid": 48,
        "hostname": "mc-lbnode-1",
        "pid": 27731,
        "comm": "sudo",
        "message": "  apache : TTY=unknown ; PWD=/var/www/html/lb_api/web ; USER=root ; COMMAND=/usr/bin/systemctl is-active snmpd",
        "unit": "php-fpm.service",
        "level": "info",
        "cursor": "s=06f3eafa5a29463cb59c27dda244f4f0;i=6716a5;b=daa968a6a15d460e855c378615e20d67;m=5081badb;t=5d4c242c165e0;x=bb9bdec32f45271c"
      },
      {
        "datetime": "2022-01-05 11:49:03",
        "uid": 0,
        "gid": 0,
        "hostname": "mc-lbnode-1",
        "pid": 22412,
        "comm": "sudo",
        "message": "pam_unix(sudo:session): session opened for user root by (uid=0)",
        "unit": "php-fpm.service",
        "level": "info",
        "cursor": "s=06f3eafa5a29463cb59c27dda244f4f0;i=6716a6;b=daa968a6a15d460e855c378615e20d67;m=5081badc;t=5d4d4571b00c0;x=4d2ab5ce7b05b621"
      }
    ],
    "start": "2022-01-04T14:14:52+00:00",
    "end": "2022-01-05T11:49:03+00:00",
    "first": "2021-12-01T08:00:12+00:00",
    "last": "2022-01-05T11:49:03+00:00",
    "cursor": "s=06f3eafa5a29463cb59c27dda244f4f0;i=6716a6;b=daa968a6a15d460e855c378615e20d67;m=5081badc;t=5d4d4571b00c0;x=4d2ab5ce7b05b621",
    "more": true,
    "futureEntries": false
  }
}

List the log services

List the names /logs can filter on, each once: every service the appliance runs (group service), then every other process that has written to the journal, under its process name (group system). A daemon’s own process names — rsyslogd for rsyslog, systemd-journal for systemd-journald — and what a process logs before it starts, recorded under a bracketed name such as (cheduler), are listed with it, not again.

GET /{applianceId}/logs/services

Path parameters
applianceId string Required

The id of the cluster node the request is for.

curl
curl -X GET "https://appliance.example.com/api/v1/{applianceId}/logs/services" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/{applianceId}/logs/services';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/{applianceId}/logs/services", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/{applianceId}/logs/services', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Bruno
meta {
  name: List the log services
  type: http
  seq: 1
}

get {
  url: https://{{node-0}}:{{port}}/api/v1/{applianceId}/logs/services
  body: none
  auth: bearer
}

auth:bearer {
  token: {{token}}
}
Response
{
  "status": "success",
  "message": "Logs Service",
  "data": [
    {
      "name": "haproxy",
      "nameFull": "HAProxy",
      "group": "service"
    },
    {
      "name": "pulseha",
      "nameFull": "PulseHA",
      "group": "service"
    },
    {
      "name": "php-fpm",
      "nameFull": "PHP",
      "group": "service"
    },
    {
      "name": "nfscheduler",
      "nameFull": "nfscheduler",
      "group": "system"
    },
    {
      "name": "sudo",
      "nameFull": "sudo",
      "group": "system"
    },
    {
      "name": "systemd",
      "nameFull": "systemd",
      "group": "system"
    }
  ]
}