API Reference
POSTopensearch-logs

Get OpenSearch Logs

Get OpenSearch Logs is a POST request to https://api.sharkcluster.com/opensearch-logs in the Server Management section of the SharkCluster API. Fetches specific logs from the OpenSearch service on a server. It supports retrieving different log types such as main, GC, deprecation, slow logs, and systemd logs. It takes 4 parameters, 4 required (server_id, host, lines and log_type).

Request URL

POSThttps://api.sharkcluster.com/opensearch-logs

How do you call Get OpenSearch Logs?

  1. 1Send a POST request to https://api.sharkcluster.com/opensearch-logs.
  2. 2Include the required parameters: server_id, host, lines and log_type.

Request parameters

ParameterTypeDescription
server_id
Required
stringID of the server (required if host is not provided).
host
Required
stringIP address of the server (required if server_id is not provided).
lines
Required
integerNumber of lines to fetch from the end of the log file.
log_type
Required
stringType of log to fetch ('main', 'gc', 'deprecation', 'slowlog', 'systemd').

What does Get OpenSearch Logs return?

A failed call explains the problem in the body, for example "Failed to fetch OpenSearch logs".

Request sample

const axios = require('axios');
const data = {
  server_id: "server_123",
  lines: 100,
  log_type: "main"
};

axios.post('https://api.sharkcluster.com/opensearch-logs', data)
  .then(response => console.log(response.data))
  .catch(error => console.error(error.response.data));

Stuck on an integration?

Raise a ticket from the panel with the endpoint and the response you got back — it reaches an engineer with your server already attached.

Contact us