Accessing Opensearch Dashboards features via REST API
You can use Basic Authentication to connect to the Logit.io Proxy and access Opensearch Dashboards without having to go through the Logit.io Dashboard. This can improve your user experience and allow proper integration between your company, your applications and the Logit.io service.
You can, if you choose to, connect your application directly to Logit.io to do a range of things such as load dashboards, visualisations, index patterns and mappings etc. or simply load them straight from your computer.
This article explains how to call REST API Endpoints to access Opensearch Dashboards using our Logit.io proxy and connect to it using Basic Authentication.
Basic Authentication is a simple authentication method in HTTP(S) where the client includes a username and password with each request. The username and password is combined with a colon in-between as a string. You don't need to worry about how to create a basic authentication header as we have done it for you.
Each request to a REST API Endpoint must include all of the necessary information for Opensearch Dashboards to fulfill the request. If all the necessary information is provided the API requests return JSON output.
Use the following operations to interact with the Opensearch Dashboards via the Logit.io Proxy.
- GET - Fetches the information.
- POST - Adds new information.
- PUT - Updates the existing information.
- PATCH - Applies partial modifications to the existing information.
- DELETE - Removes the information.
All the details that you require in order to connect to the Logit.io proxy are found on the Profile Settings page of the Logit.io Dashboard.
The Profile Settings page has a section called Proxy Settings
where you will find everything that you need.
Click here (opens in a new tab) to view you profile page.
Below are two curl request examples that show how to connect to the Logit.io Proxy. The examples use the Stack Id of a Stack that you have access to. If you need to access another of your stacks then you can simply find the Stack that you require, retrieve the stack Id from that stack and then replace it.
Example of a curl request to access your Logit.io Opensearch Dashboards instance
There are two ways that you can call the REST API using the Logit.io proxy. The call to our proxy needs to be in either of the following formats:
This first method uses the Basic Auth Header:
curl -XGET -H "osd-xsrf:true" -H "Content-Type: application/json" ^
-H "Authorization: Basic ^
@proxyAuthSetting.basicAuthHeader" ^
https://kibana.logit.io/s/@logs_id/api/status
This second method uses the proxy username and password:
curl -XGET -H "osd-xsrf:true" -H "Content-Type: application/json" ^
-u "@proxyAuthSetting.username:@proxyAuthSetting.password" ^
https://kibana.logit.io/s/@logs_id/api/status
Both curl requests call the same API Endpoint. This request returns detailed information about your Opensearch Dashboards instance’s health including the resource usage, the server status, installed plugins, plugin statuses and metrics.
There are many other Opensearch Dashboards features that can be accessed via REST API through the Logit.io Proxy. These features are explained in the Elastic docs here (opens in a new tab)