Logs

Journal

GET /logs/servers/journal

List the journal servers

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();
Response
{
  "status": "success",
  "message": "Journal Server/s",
  "data": [
    {
      "id": "6e7-d6e-326-f29",
      "protocol": "http",
      "ipDomain": "100.100.100.100",
      "port": 514
    }
  ]
}

POST /logs/servers/journal

Add Journal Server

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();
Response
{
  "status": "success",
  "message": "Journal Server added",
  "data": {
    "id": "5ca-35d-687-c1f"
  }
}

Journal by ID

GET /logs/servers/journal/{id}

Get Journal Server By 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();
Response
{
  "status": "success",
  "message": "Journal Server",
  "data": {
    "id": "6e7-d6e-326-f29",
    "protocol": "http",
    "ipDomain": "100.100.100.100",
    "port": 514
  }
}

PUT /logs/servers/journal/{id}

Edit a Journal Server

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();
Response
{
  "status": "success",
  "message": "Journal Server edited",
  "data": {
    "id": "5ca-35d-687-7c1"
  }
}

DELETE /logs/servers/journal/{id}

Delete Journal Server

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();
Response
{
  "status": "success",
  "message": "Journal Server deleted"
}

Syslog

GET /logs/servers/syslog

List the syslog servers

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();
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"
    }
  ]
}

POST /logs/servers/syslog

Add Syslog Server

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)

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();
Response
{
  "status": "success",
  "message": "Syslog Server added",
  "data": {
    "id": "5ca-35d-687-c1f"
  }
}

Syslog by ID

GET /logs/servers/syslog/{id}

Get Syslog Server By 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();
Response
{
  "status": "success",
  "message": "Syslog Server",
  "data": {
    "id": "6e7-d6e-326-f29",
    "protocol": "tls",
    "ipDomain": "collectors.example.com",
    "port": 6514,
    "token": "********",
    "caId": "ca-123"
  }
}

PUT /logs/servers/syslog/{id}

Edit a Syslog Server

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); blank/masked keeps the stored token

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();
Response
{
  "status": "success",
  "message": "Syslog Server edited",
  "data": {
    "id": "5ca-35d-687-7c1"
  }
}

DELETE /logs/servers/syslog/{id}

Delete Syslog Server

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();
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();
Response
{
  "status": "success",
  "message": "Journal Setting",
  "data": {
    "maxUseGBytes": 30,
    "maxFileSizeMBytes": 500,
    "maxFiles": 61,
    "keepFreeGBytes": 1,
    "maxRetentionSecWeeks": 26
  }
}

PUT /logs/settings

Update 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();
Response
{
  "status": "success",
  "message": "Journal settings updated"
}

Read the appliance logs

GET /{applianceId}/logs

Get Logs also returns the start/end date and time of the logs returned and the first/last date and time of the logs in the system

Path parameters
applianceId string Required

The id of the cluster node the request is for.

Query parameters
service array
lines integer default: "1000"
since string

format YYYY-MM-DD HH:MM:SS

until string

format YYYY-MM-DD HH:MM:SS

reverse boolean default: "false"
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();
Response
{
  "status": "success",
  "message": "Logs",
  "data": {
    "logs": [
      {
        "datetime": "2022-01-04T14:14:52+0000",
        "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"
      },
      {
        "datetime": "2022-01-05T11:49:03+0000",
        "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)"
      }
    ],
    "start": "2022-01-04T14:14:52+00:00",
    "end": "2022-01-05T11:49:03+00:00",
    "first": "2022-01-04T14:14:52+00:00",
    "last": "2022-01-04T14:14:52+00:00"
  }
}

Read the logs of a service

GET /{applianceId}/logs/services

Get Logs Service

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();
Response
{
  "status": "success",
  "message": "Logs Service",
  "data": [
    {
      "name": "gslb",
      "nameFull": "GSLB"
    },
    {
      "name": "haproxy",
      "nameFull": "HAProxy"
    },
    {
      "name": "nginx_fallback",
      "nameFull": "Fallback Pages"
    },
    {
      "name": "pulseha",
      "nameFull": "PulseHA"
    },
    {
      "name": "nginx",
      "nameFull": "NGINX"
    },
    {
      "name": "php-fpm",
      "nameFull": "PHP"
    }
  ]
}