API Reference
POST
opensearch-logsGet 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
POST
https://api.sharkcluster.com/opensearch-logsHow do you call Get OpenSearch Logs?
- 1Send a POST request to https://api.sharkcluster.com/opensearch-logs.
- 2Include the required parameters: server_id, host, lines and log_type.
Request parameters
| Parameter | Type | Description |
|---|---|---|
server_idRequired | string | ID of the server (required if host is not provided). |
hostRequired | string | IP address of the server (required if server_id is not provided). |
linesRequired | integer | Number of lines to fetch from the end of the log file. |
log_typeRequired | string | Type 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));
Related Server Management endpoints
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.