Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a4d4dabba | |||
| 05d6b6cb5d | |||
| 6e9249e58c | |||
| 432005eaa0 | |||
| 3d3bc88422 | |||
| 75a835f29b | |||
| d00637b05e | |||
| 73667cafd0 | |||
| 59969664a5 | |||
| 3c27d762ef | |||
| 47bd70cb2b | |||
| b8bf7a2f1d | |||
| 6c6c9c619f | |||
| a335f8741a | |||
| 92b3b49ee2 | |||
| cf769012ca | |||
| 4a2e1c32db | |||
| 79b647ee62 | |||
| e5bec0b980 | |||
| d3d9774eaf | |||
| e484b3e93f | |||
| d7ce813388 | |||
| 81bf0b2655 | |||
| 21b4c3ab87 | |||
| 24acbc3d56 | |||
| d6770ec66e | |||
| 62491a2a98 | |||
| b81261034b | |||
| 5d5dc6c413 | |||
| b79ee7cf34 | |||
| 7488bc3d83 | |||
| 87d14aedf0 | |||
| 7424f51f82 | |||
| c769eea533 | |||
| 8f635fe5cd | |||
| 4693e3ba27 | |||
| 8fbdb4ba11 | |||
| 4d3db0bbd4 | |||
| 6569051dc8 | |||
| e4219fe761 | |||
| 268a85ba0c | |||
| 1835b3ec37 | |||
| 29feadfb57 | |||
| 041fd93005 | |||
| 676314ceaf | |||
| 4edfffe18c | |||
| 475f1227ff | |||
| 13f7a847c1 | |||
| 40c6f07871 | |||
| 82fce438bc | |||
| 0094f38d4d | |||
| 4cd5ceb312 | |||
| e347a869bc | |||
| a179929bdb | |||
| 119b9e79ec | |||
| 4ca66d11c3 | |||
| f47b41b984 | |||
| c0ddecacd8 | |||
| 07a22dff69 | |||
| de06d8b143 | |||
| d997df6164 | |||
| 93409f1333 | |||
| e7cc6db397 | |||
| 85d9de759c | |||
| df471fb310 | |||
| c38f9f9905 | |||
| cfd782d857 | |||
| 8702fa875b | |||
| 70837a3f9e | |||
| 8ee083b6d2 | |||
| d3a26b8353 | |||
| 4e469c2579 | |||
| dd964c3b78 | |||
| 59e7b8d64a | |||
| c8049ae44c |
@@ -4,3 +4,4 @@ _site
|
||||
.DS_Store
|
||||
Gemfile.lock
|
||||
.idea
|
||||
.jekyll-cache
|
||||
|
||||
@@ -34,7 +34,7 @@ If you encounter problems or have questions when contributing to the documentati
|
||||
|
||||
After each commit to this repository, GitHub Pages automatically uses [Jekyll](https://jekyllrb.com) to rebuild the [website](https://docs-beta.opensearch.org). The whole process takes around 30 seconds.
|
||||
|
||||
This repository contains many [Markdown](https://guides.github.com/features/mastering-markdown/) files in the `/docs` directory. Each Markdown file correlates with one page on the website. For example, the Markdown file for [this page](https://docs-beta.opensearch.org/docs/opensearch/) is [here](https://github.com/opensearch-project/documentation-website/blob/master/docs/opensearch/index.md).
|
||||
This repository contains many [Markdown](https://guides.github.com/features/mastering-markdown/) files in the `/docs` directory. Each Markdown file correlates with one page on the website.
|
||||
|
||||
Using plain text on GitHub has many advantages:
|
||||
|
||||
|
||||
@@ -15,6 +15,19 @@ As an intermediate solution, we are adding a [version value](https://github.com/
|
||||
For a longer term solution, we plan to create an OpenSearch output plugin for Logstash. This plugin *does not exist yet*, but we've included it in the compatibility matrices below based on its expected behavior.
|
||||
|
||||
|
||||
## Downloads
|
||||
|
||||
These versions of Logstash and Beats offer the best compatibility with OpenSearch. For more information, see the [compatibility matrices](#compatibility-matrices).
|
||||
|
||||
- [Logstash OSS 7.12.1](https://www.elastic.co/downloads/past-releases/logstash-oss-7-12-1)
|
||||
- [Filebeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/filebeat-oss-7-12-1)
|
||||
- [Metricbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/metricbeat-oss-7-12-1)
|
||||
- [Packetbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/packetbeat-oss-7-12-1)
|
||||
- [Heartbeat OSS 7.12.1](https://elastic.co/downloads/past-releases/heartbeat-oss-7-12-1)
|
||||
- [Winlogbeat OSS 7.12.1](https://www.elastic.co/downloads/past-releases/winlogbeat-oss-7-12-1)
|
||||
- [Auditbeat OSS 7.12.1](https://elastic.co/downloads/past-releases/auditbeat-oss-7-12-1)
|
||||
|
||||
|
||||
## Compatibility Matrices
|
||||
|
||||
*Italicized* cells are untested, but indicate what a value theoretically should be based on existing information.
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
---
|
||||
layout: default
|
||||
title: Java high-level REST client
|
||||
nav_order: 97
|
||||
---
|
||||
|
||||
# Java high-level REST client
|
||||
|
||||
The Elasticsearch OSS Java high-level REST client allows you to interact with your OpenSearch clusters and indices through Java methods and data structures rather than HTTP methods and JSON.
|
||||
|
||||
You submit requests to your cluster using request objects, which allows you to create indices, add data to documents, or complete other operations with your cluster. In return, you get back response objects that have all of the available information, such as the associated index or ID, from your cluster.
|
||||
|
||||
## Setup
|
||||
|
||||
To start using the Elasticsearch OSS Java high-level REST client, ensure that you have the following dependency in your project's `pom.xml` file:
|
||||
|
||||
```
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.10.2</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
You can now start your OpenSearch cluster. The 7.10.2 high-level REST client works with the 1.x versions of OpenSearch.
|
||||
|
||||
## Sample code
|
||||
|
||||
```java
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.CredentialsProvider;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
|
||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
||||
import org.elasticsearch.action.delete.DeleteRequest;
|
||||
import org.elasticsearch.action.delete.DeleteResponse;
|
||||
import org.elasticsearch.action.get.GetRequest;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.index.IndexRequest;
|
||||
import org.elasticsearch.action.index.IndexResponse;
|
||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||
import org.elasticsearch.client.RequestOptions;
|
||||
import org.elasticsearch.client.RestClient;
|
||||
import org.elasticsearch.client.RestClientBuilder;
|
||||
import org.elasticsearch.client.RestHighLevelClient;
|
||||
import org.elasticsearch.client.indices.CreateIndexRequest;
|
||||
import org.elasticsearch.client.indices.CreateIndexResponse;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentType;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class RESTClientSample {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
//Point to keystore with appropriate certificates for security.
|
||||
System.setProperty("javax.net.ssl.trustStore", "/full/path/to/keystore");
|
||||
System.setProperty("javax.net.ssl.trustStorePassword", password-to-keystore);
|
||||
|
||||
//Establish credentials to use basic authentication.
|
||||
//Only for demo purposes. Do not specify your credentials in code.
|
||||
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||
|
||||
credentialsProvider.setCredentials(AuthScope.ANY,
|
||||
new UsernamePasswordCredentials("admin", "admin"));
|
||||
|
||||
//Create a client.
|
||||
RestClientBuilder builder = RestClient.builder(new HttpHost("localhost", 9200, "https"))
|
||||
.setHttpClientConfigCallback(new RestClientBuilder.HttpClientConfigCallback() {
|
||||
@Override
|
||||
public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) {
|
||||
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
|
||||
}
|
||||
});
|
||||
RestHighLevelClient client = new RestHighLevelClient(builder);
|
||||
|
||||
//Create a non-default index with custom settings and mappings.
|
||||
CreateIndexRequest createIndexRequest = new CreateIndexRequest("test-index");
|
||||
|
||||
createIndexRequest.settings(Settings.builder() //Specify in the settings how many shards you want in the index.
|
||||
.put("index.number_of_shards", 4)
|
||||
.put("index.number_of_replicas", 3)
|
||||
);
|
||||
//Create a set of maps for the index's mappings.
|
||||
HashMap<String, String> typeMapping = new HashMap<String,String>();
|
||||
typeMapping.put("type", "integer");
|
||||
HashMap<String, Object> ageMapping = new HashMap<String, Object>();
|
||||
ageMapping.put("age", typeMapping);
|
||||
HashMap<String, Object> mapping = new HashMap<String, Object>();
|
||||
mapping.put("properties", ageMapping);
|
||||
createIndexRequest.mapping(mapping);
|
||||
CreateIndexResponse createIndexResponse = client.indices().create(createIndexRequest, RequestOptions.DEFAULT
|
||||
|
||||
//Adding data to the index.
|
||||
IndexRequest request = new IndexRequest("custom-index"); //Add a document to the custom-index we created.
|
||||
request.id("1"); //Assign an ID to the document.
|
||||
|
||||
HashMap<String, String> stringMapping = new HashMap<String, String>();
|
||||
stringMapping.put("message:", "Testing Java REST client");
|
||||
request.source(stringMapping); //Place your content into the index's source.
|
||||
IndexResponse indexResponse = client.index(request, RequestOptions.DEFAULT);
|
||||
|
||||
//Getting back the document
|
||||
GetRequest getRequest = new GetRequest("custom-index", "1");
|
||||
GetResponse response = client.get(getRequest, RequestOptions.DEFAULT);
|
||||
|
||||
System.out.println(response.getSourceAsString());
|
||||
|
||||
//Delete the document
|
||||
DeleteRequest deleteDocumentRequest = new DeleteRequest("custom-index", "1"); //Index name followed by the ID.
|
||||
DeleteResponse deleteResponse = client.delete(deleteDocumentRequest, RequestOptions.DEFAULT);
|
||||
|
||||
//Delete the index
|
||||
DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest("custom-index"); //Index name.
|
||||
AcknowledgedResponse deleteIndexResponse = client.indices().delete(deleteIndexRequest, RequestOptions.DEFAULT);
|
||||
|
||||
client.close();
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -27,7 +27,7 @@ color_scheme: opensearch
|
||||
# Define Jekyll collections
|
||||
collections:
|
||||
# Define a collection named "tests", its documents reside in the "_tests" directory
|
||||
migrate:
|
||||
upgrade-to:
|
||||
permalink: /:collection/:path/
|
||||
output: true
|
||||
opensearch:
|
||||
@@ -61,8 +61,8 @@ collections:
|
||||
just_the_docs:
|
||||
# Define the collections used in the theme
|
||||
collections:
|
||||
migrate:
|
||||
name: Migrate to OpenSearch
|
||||
upgrade-to:
|
||||
name: Upgrade to OpenSearch
|
||||
# nav_exclude: true
|
||||
nav_fold: true
|
||||
# search_exclude: true
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
layout: default
|
||||
title: Configure TLS
|
||||
parent: Install OpenSearch Dashboards
|
||||
nav_order: 40
|
||||
---
|
||||
|
||||
# Configure TLS for OpenSearch Dashboards
|
||||
|
||||
By default, for ease of testing and getting started, OpenSearch Dashboards runs over HTTP. To enable TLS for HTTPS, update the following settings in `opensearch_dashboards.yml`.
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
opensearch.ssl.verificationMode | This setting is for communications between OpenSearch and OpenSearch Dashboards. Valid values are `full`, `certificate`, or `none`. We recommend `full` if you enable TLS, which enables hostname verification. `certificate` just checks the certificate, not the hostname, and `none` performs no checks (suitable for HTTP). Default is `full`.
|
||||
opensearch.ssl.certificateAuthorities | If `opensearch.ssl.verificationMode` is `full` or `certificate`, specify the full path (e.g. `[ "/usr/share/opensearch-dashboards-1.0.0/config/root-ca.pem" ]` to the certificate authority for your OpenSearch cluster.
|
||||
server.ssl.enabled | This setting is for communications between OpenSearch Dashboards and the web browser. Set to true for HTTPS, false for HTTP.
|
||||
server.ssl.certificate | If `server.ssl.enabled` is true, specify the full path (e.g. `/usr/share/opensearch-dashboards-1.0.0/config/my-client-cert.pem` to a valid client certificate for your OpenSearch cluster. You can [generate your own]({{site.url}}{{site.baseurl}}/security-plugin/configuration/generate-certificates/) or get one from a certificate authority.
|
||||
server.ssl.key | If `server.ssl.enabled` is true, specify the full path (e.g. `/usr/share/opensearch-dashboards-1.0.0/config/my-client-cert-key.pem` to the key for your client certificate. You can [generate your own]({{site.url}}{{site.baseurl}}/security-plugin/configuration/generate-certificates/) or get one from a certificate authority.
|
||||
opensearch_security.cookie.secure | If you enable TLS for OpenSearch Dashboards, change this setting to `true`. For HTTP, set it to `false`.
|
||||
|
||||
This `opensearch_dashboards.yml` configuration shows OpenSearch and OpenSearch Dashboards running on the same machine with the demo configuration:
|
||||
|
||||
```yml
|
||||
opensearch.hosts: ["https://localhost:9200"]
|
||||
opensearch.ssl.verificationMode: full
|
||||
opensearch.username: "kibanaserver"
|
||||
opensearch.password: "kibanaserver"
|
||||
opensearch.requestHeadersWhitelist: [ authorization,securitytenant ]
|
||||
server.ssl.enabled: true
|
||||
server.ssl.certificate: /usr/share/opensearch-1.0.0/config/client-cert.pem
|
||||
server.ssl.key: /usr/share/opensearch-1.0.0/config/client-cert-key.pem
|
||||
opensearch.ssl.certificateAuthorities: [ "/usr/share/opensearch-1.0.0/config/root-ca.pem" ]
|
||||
opensearch_security.multitenancy.enabled: true
|
||||
opensearch_security.multitenancy.tenants.preferred: ["Private", "Global"]
|
||||
opensearch_security.readonly_mode.roles: ["kibana_read_only"]
|
||||
opensearch_security.cookie.secure: true
|
||||
```
|
||||
|
||||
If you use the Docker install, you can pass a custom `opensearch_dashboards.yml` to the container. To learn more, see the [Docker installation page]({{site.url}}{{site.baseurl}}/opensearch/install/docker/).
|
||||
|
||||
After enabling these settings and starting OpenSearch Dashboards, you can connect to it at `https://localhost:5601`. You might have to acknowledge a browser warning if your certificates are self-signed. To avoid this sort of warning (or outright browser incompatibility), best practice is to use certificates from trusted certificate authority.
|
||||
@@ -1,28 +1,30 @@
|
||||
---
|
||||
layout: default
|
||||
title: Notebooks (experimental)
|
||||
title: Notebooks
|
||||
nav_order: 50
|
||||
redirect_from: /docs/notebooks/
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# OpenSearch Dashboards notebooks (experimental)
|
||||
# Notebooks
|
||||
|
||||
Notebooks have a known issue with [tenants]({{site.url}}{{site.baseurl}}/security-plugin/access-control/multi-tenancy/). If you open a notebook and can't see its visualizations, you might be under the wrong tenant, or you might not have access to the tenant at all.
|
||||
{: .warning }
|
||||
|
||||
An OpenSearch Dashboards notebook is an interface that lets you easily combine live visualizations and narrative text in a single notebook interface.
|
||||
An OpenSearch Dashboards notebook is an interface that lets you easily combine code snippets, live visualizations, and narrative text in a single notebook interface.
|
||||
|
||||
Notebooks let you interactively explore data by running different visualizations that you can share with team members to collaborate on a project.
|
||||
|
||||
A notebook is a document composed of two elements: OpenSearch Dashboards visualizations and paragraphs (Markdown). Choose multiple timelines to compare and contrast visualizations.
|
||||
A notebook is a document composed of two elements: code blocks (Markdown/SQL/PPL) and visualizations. Choose multiple timelines to compare and contrast visualizations.
|
||||
|
||||
You can also generate [reports]({{site.url}}{{site.baseurl}}/dashboards/reporting/) directly from your notebooks.
|
||||
|
||||
Common use cases include creating postmortem reports, designing runbooks, building live infrastructure reports, and writing documentation.
|
||||
|
||||
Tenants in OpenSearch Dashboards are spaces for saving notebooks and other OpenSearch Dashboards objects. For more information, see [OpenSearch Dashboards multi-tenancy]({{site.url}}{{site.baseurl}}/security-plugin/access-control/multi-tenancy/).
|
||||
{: .note }
|
||||
|
||||
## Get Started with notebooks
|
||||
|
||||
To get started, choose **OpenSearch Dashboards Notebooks** within OpenSearch Dashboards.
|
||||
## Get started with notebooks
|
||||
|
||||
To get started, choose **Notebooks** within OpenSearch Dashboards.
|
||||
|
||||
|
||||
### Step 1: Create a notebook
|
||||
@@ -32,28 +34,58 @@ A notebook is an interface for creating reports.
|
||||
1. Choose **Create notebook** and enter a descriptive name.
|
||||
1. Choose **Create**.
|
||||
|
||||
Choose **Notebook actions** to rename, duplicate, or delete a notebook.
|
||||
Choose **Actions** to rename, duplicate, or delete a notebook.
|
||||
|
||||
|
||||
### Step 2: Add a paragraph
|
||||
|
||||
Paragraphs combine text and visualizations for describing data.
|
||||
Paragraphs combine code blocks and visualizations for describing data.
|
||||
|
||||
#### Add a code block
|
||||
|
||||
#### Add a markdown paragraph
|
||||
Code blocks support markdown, SQL, and PPL languages.
|
||||
|
||||
1. To add text, choose **Add markdown paragraph**.
|
||||
1. Add rich text with markdown syntax.
|
||||
Specify the input language on the first line using `%[language type]` syntax.
|
||||
For example, type `%md` for markdown, `%sql` for SQL, and `%ppl` for PPL.
|
||||
|
||||
##### Sample markdown block
|
||||
|
||||
```
|
||||
%md
|
||||
Add in text formatted in markdown.
|
||||
```
|
||||
|
||||

|
||||
|
||||
##### Sample SQL block
|
||||
|
||||
#### Add a visualization paragraph
|
||||
```sql
|
||||
%sql
|
||||
Select * from opensearch_dashboards_sample_data_flights limit 20;
|
||||
```
|
||||
|
||||
1. To add a visualization, choose **Add OpenSearch Dashboards visualization paragraph**.
|
||||

|
||||
|
||||
##### Sample PPL block
|
||||
|
||||
```
|
||||
%ppl
|
||||
source=opensearch_dashboards_sample_data_logs | head 20
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
#### Add a visualization
|
||||
|
||||
1. To add a visualization, choose **Add paragraph** and select **Visualization**.
|
||||
1. In **Title**, select your visualization and choose a date range. You can choose multiple timelines to compare and contrast visualizations.
|
||||
1. To run and save a paragraph, choose **Run**.
|
||||
|
||||

|
||||
|
||||
## Paragraph actions
|
||||
|
||||
You can perform the following actions on paragraphs:
|
||||
|
||||
- Add a new paragraph to the top of a report.
|
||||
@@ -62,3 +94,25 @@ You can perform the following actions on paragraphs:
|
||||
- Clear the outputs of all paragraphs.
|
||||
- Delete all the paragraphs.
|
||||
- Move paragraphs up and down.
|
||||
|
||||
## Sample notebooks
|
||||
|
||||
We prepared the following sample notebooks that showcase a variety of use cases:
|
||||
|
||||
- Using SQL to query the OpenSearch Dashboards sample flight data.
|
||||
- Using PPL to query the OpenSearch Dashboards sample web logs data.
|
||||
- Using PPL and visualizations to perform sample root cause event analysis on the OpenSearch Dashboards sample web logs data.
|
||||
|
||||
To add a sample notebook, choose **Actions** and select **Add sample notebooks**.
|
||||
|
||||
## Create a report
|
||||
|
||||
You can use notebooks to create PNG and PDF reports:
|
||||
|
||||
1. From the top menu bar, choose **Reporting actions**.
|
||||
1. You can choose to **Download PDF** or **Download PNG**.
|
||||
|
||||
Reports generate asynchronously in the background and might take a few minutes, depending on the size of the report. A notification appears when your report is ready to download.
|
||||
|
||||
1. To create a schedule-based report, choose **Create report definition**. For steps to create a report definition, see [Create reports using a definition]({{site.url}}{{site.baseurl}}/dashboards/reporting#create-reports-using-a-definition).
|
||||
1. To see all your reports, choose **View all reports**.
|
||||
|
||||
@@ -9,6 +9,9 @@ nav_order: 20
|
||||
|
||||
You can use OpenSearch Dashboards to create PNG, PDF, and CSV reports. To create reports, you must have the correct permissions. For a summary of the predefined roles and the permissions they grant, see the [security plugin]({{site.url}}{{site.baseurl}}/security-plugin/access-control/users-roles#predefined-roles).
|
||||
|
||||
CSV reports have a non-configurable 10,000 row limit. They have no explicit size limit (e.g. in MB), but extremely large documents could cause report generation to fail with an out of memory error from the V8 JavaScript engine.
|
||||
{: .tip }
|
||||
|
||||
|
||||
## Create reports from Discovery, Visualize, or Dashboard
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: About migrating
|
||||
nav_order: 1
|
||||
redirect_from: /migrate/
|
||||
---
|
||||
|
||||
# About migrating
|
||||
|
||||
The process of migrating from Elasticsearch OSS (including Open Distro for Elasticsearch) to OpenSearch varies depending on your current version of Elasticsearch OSS, install type, tolerance for downtime, and cost-sensitivity. Rather than concrete steps to cover every situation, we have general guidance for the process.
|
||||
|
||||
To safeguard against data loss, we recommend that you take a [snapshot]({{site.url}}{{site.baseurl}}/opensearch/snapshot-restore/) of all indices prior to any migration.
|
||||
{: .tip }
|
||||
@@ -912,6 +912,27 @@ POST _plugins/_alerting/destinations
|
||||
"host": "hooks.chime.aws"
|
||||
}
|
||||
}
|
||||
|
||||
POST _plugins/_alerting/destinations
|
||||
{
|
||||
"type": "email",
|
||||
"name": "my-email-destination",
|
||||
"email": {
|
||||
"email_account_id": "YjY7mXMBx015759_IcfW",
|
||||
"recipients": [
|
||||
{
|
||||
"type": "email_group",
|
||||
"email_group_id": "YzY-mXMBx015759_dscs"
|
||||
},
|
||||
{
|
||||
"type": "email",
|
||||
"email": "example@email.com"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// The email_account_id and email_group_id will be the document IDs of the email_account and email_group you have created.
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
@@ -15,7 +15,7 @@ Data Prepper is an independent component, not an OpenSearch plugin, that convert
|
||||
To use the Docker image, pull it like any other image:
|
||||
|
||||
```bash
|
||||
docker pull opensearch/opensearch-data-prepper:latest
|
||||
docker pull opensearchproject/data-prepper:latest
|
||||
```
|
||||
|
||||
Otherwise, [download](https://opensearch.org/downloads.html) the appropriate archive for your operating system and unzip it.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Aggregations
|
||||
nav_order: 13
|
||||
nav_order: 14
|
||||
has_children: true
|
||||
---
|
||||
|
||||
|
||||
@@ -1,256 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT API
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# cat API
|
||||
|
||||
You can get essential statistics about your cluster in an easy-to-understand, tabular format using the compact and aligned text (CAT) API. The cat API is a human-readable interface that returns plain text instead of traditional JSON.
|
||||
|
||||
Using the cat API, you can answer questions like which node is the elected master, what state is the cluster in, how many documents are in each index, and so on.
|
||||
|
||||
To see the available operations in the cat API, use the following command:
|
||||
|
||||
```
|
||||
GET _cat
|
||||
```
|
||||
|
||||
You can also use the following string parameters with your query.
|
||||
|
||||
Parameter | Description
|
||||
:--- | :--- |
|
||||
`?v` | Makes the output more verbose by adding headers to the columns. It also adds some formatting to help align each of the columns together. All examples on this page include the `v` parameter.
|
||||
`?help` | Lists the default and other available headers for a given operation.
|
||||
`?h` | Limits the output to specific headers.
|
||||
`?format` | Outputs the result in JSON, YAML, or CBOR formats.
|
||||
`?sort` | Sorts the output by the specified columns.
|
||||
|
||||
To see what each column represents, use the `?v` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?v
|
||||
```
|
||||
|
||||
To see all the available headers, use the `?help` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?help
|
||||
```
|
||||
|
||||
To limit the output to a subset of headers, use the `?h` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
|
||||
```
|
||||
|
||||
Typically, for any operation you can find out what headers are available using the `?help` parameter, and then use the `?h` parameter to limit the output to only the headers that you care about.
|
||||
|
||||
---
|
||||
|
||||
#### Table of contents
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
---
|
||||
## Aliases
|
||||
|
||||
Lists the mapping of aliases to indices, plus routing and filtering information.
|
||||
|
||||
```
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
|
||||
To limit the information to a specific alias, add the alias name after your query.
|
||||
|
||||
```
|
||||
GET _cat/aliases/<alias>?v
|
||||
```
|
||||
|
||||
## Allocation
|
||||
|
||||
Lists the allocation of disk space for indices and the number of shards on each node.
|
||||
Default request:
|
||||
```
|
||||
GET _cat/allocation?v
|
||||
```
|
||||
|
||||
## Count
|
||||
|
||||
Lists the number of documents in your cluster.
|
||||
|
||||
```
|
||||
GET _cat/count?v
|
||||
```
|
||||
|
||||
To see the number of documents in a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/count/<index>?v
|
||||
```
|
||||
|
||||
## Field data
|
||||
|
||||
Lists the memory size used by each field per node.
|
||||
|
||||
```
|
||||
GET _cat/fielddata?v
|
||||
```
|
||||
|
||||
To limit the information to a specific field, add the field name after your query.
|
||||
|
||||
```
|
||||
GET _cat/fielddata/<fields>?v
|
||||
```
|
||||
|
||||
## Health
|
||||
|
||||
Lists the status of the cluster, how long the cluster has been up, the number of nodes, and other useful information that helps you analyze the health of your cluster.
|
||||
|
||||
```
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## Indices
|
||||
|
||||
Lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on.
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
```
|
||||
|
||||
To limit the information to a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>?v
|
||||
```
|
||||
|
||||
## Master
|
||||
|
||||
Lists information that helps identify the elected master node.
|
||||
|
||||
```
|
||||
GET _cat/master?v
|
||||
```
|
||||
|
||||
## Node attributes
|
||||
|
||||
Lists the attributes of custom nodes.
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs?v
|
||||
```
|
||||
|
||||
## Nodes
|
||||
|
||||
Lists node-level information, including node roles and load metrics.
|
||||
|
||||
A few important node metrics are `pid`, `name`, `master`, `ip`, `port`, `version`, `build`, `jdk`, along with `disk`, `heap`, `ram`, and `file_desc`.
|
||||
|
||||
```
|
||||
GET _cat/nodes?v
|
||||
```
|
||||
|
||||
## Pending tasks
|
||||
|
||||
Lists the progress of all pending tasks, including task priority and time in queue.
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks?v
|
||||
```
|
||||
|
||||
## Plugins
|
||||
|
||||
Lists the names, components, and versions of the installed plugins.
|
||||
|
||||
```
|
||||
GET _cat/plugins?v
|
||||
```
|
||||
|
||||
## Recovery
|
||||
|
||||
Lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
```
|
||||
GET _cat/recovery?v
|
||||
```
|
||||
|
||||
To see only the recoveries of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/recovery/<index>?v
|
||||
```
|
||||
|
||||
## Repositories
|
||||
|
||||
Lists all snapshot repositories and their types.
|
||||
|
||||
```
|
||||
GET _cat/repositories?v
|
||||
```
|
||||
|
||||
## Segments
|
||||
|
||||
Lists Lucene segment-level information for each index.
|
||||
|
||||
```
|
||||
GET _cat/segments?v
|
||||
```
|
||||
|
||||
To see only the information about segments of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/segments/<index>?v
|
||||
```
|
||||
|
||||
## Shards
|
||||
|
||||
Lists the state of all primary and replica shards and how they are distributed.
|
||||
|
||||
```
|
||||
GET _cat/shards?v
|
||||
```
|
||||
|
||||
To see only the information about shards of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/shards/<index>?v
|
||||
```
|
||||
|
||||
## Snapshots
|
||||
|
||||
Lists all snapshots for a repository.
|
||||
|
||||
```
|
||||
GET _cat/snapshots/<repository>?v
|
||||
```
|
||||
|
||||
## Tasks
|
||||
|
||||
Lists the progress of all tasks currently running on your cluster.
|
||||
|
||||
```
|
||||
GET _cat/tasks?v
|
||||
```
|
||||
|
||||
## Templates
|
||||
|
||||
Lists the names, patterns, order numbers, and version numbers of index templates.
|
||||
|
||||
```
|
||||
GET _cat/templates?v
|
||||
```
|
||||
|
||||
## Thread pool
|
||||
|
||||
Lists the active, queued, and rejected threads of different thread pools on each node.
|
||||
|
||||
```
|
||||
GET _cat/thread_pool?v
|
||||
```
|
||||
|
||||
To limit the information to a specific thread pool, add the thread pool name after your query.
|
||||
|
||||
```
|
||||
GET _cat/thread_pool/<thread_pool>?v
|
||||
```
|
||||
@@ -8,10 +8,10 @@ nav_order: 5
|
||||
|
||||
Most OpenSearch configuration can take place in the cluster settings API. Certain operations require you to modify `opensearch.yml` and restart the cluster.
|
||||
|
||||
Whenever possible, use the cluster settings API instead; `opensearch.yml` is local to each node, whereas the API applies the setting to all nodes in the cluster.
|
||||
Whenever possible, use the cluster settings API instead; `opensearch.yml` is local to each node, whereas the API applies the setting to all nodes in the cluster. Certain settings, however, require `opensearch.yml`. In general, these settings relate to networking, cluster formation, and the local file system. To learn more, see [Cluster formation]({{site.url}}{{site.baseurl}}/opensearch/cluster/).
|
||||
|
||||
|
||||
## Cluster settings API
|
||||
## Update cluster settings using the API
|
||||
|
||||
The first step in changing a setting is to view the current settings:
|
||||
|
||||
@@ -37,7 +37,7 @@ If you specify the same setting in multiple places, OpenSearch uses the followin
|
||||
To change a setting, just specify the new one as either persistent or transient. This example shows the flat settings form:
|
||||
|
||||
```json
|
||||
PUT /_cluster/settings
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent" : {
|
||||
"action.auto_create_index" : false
|
||||
@@ -48,7 +48,7 @@ PUT /_cluster/settings
|
||||
You can also use the expanded form, which lets you copy and paste from the GET response and change existing values:
|
||||
|
||||
```json
|
||||
PUT /_cluster/settings
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"action": {
|
||||
@@ -63,6 +63,6 @@ PUT /_cluster/settings
|
||||
|
||||
## Configuration file
|
||||
|
||||
You can find `opensearch.yml` in `/usr/share/opensearch/config/opensearch.yml` (Docker) or `/etc/opensearch/opensearch.yml` (RPM and DEB) on each node.
|
||||
You can find `opensearch.yml` in `/usr/share/opensearch/config/opensearch.yml` (Docker) or `/etc/opensearch/opensearch.yml` (most Linux distributions) on each node.
|
||||
|
||||
The demo configuration includes a number of settings for the security plugin that you should modify before using OpenSearch for a production workload. To learn more, see [Security]({{site.url}}{{site.baseurl}}/security-plugin/).
|
||||
|
||||
@@ -0,0 +1,301 @@
|
||||
---
|
||||
layout: default
|
||||
title: Data streams
|
||||
nav_order: 13
|
||||
---
|
||||
|
||||
# Data streams
|
||||
|
||||
If you're ingesting continuously generated time-series data such as logs, events, and metrics into OpenSearch, you're likely in a scenario where:
|
||||
|
||||
- You’re ingesting documents that grow rapidly.
|
||||
- You don’t need to update older documents.
|
||||
- Your searches generally target the newer documents.
|
||||
|
||||
A typical workflow to manage time-series data is as follows:
|
||||
|
||||
- To split your data into an index for each day, use the rollover operation.
|
||||
- To perform searches on a virtual index name that gets expanded to the underlying indices, create an [index alias]({{site.url}}{{site.baseurl}}/opensearch/index-alias/).
|
||||
- To perform a write operation on an index alias, configure the latest index as the write index.
|
||||
- To configure new indices, extract common mappings and settings into an [index template]({{site.url}}{{site.baseurl}}/opensearch/index-templates/).
|
||||
|
||||
Even after you perform all these operations, you’re still not enforcing the best practices when dealing with time-series data. For example, you can modify the indices directly. You’re able to ingest documents without a timestamp field, which might result in slower queries.
|
||||
|
||||
Data streams abstract the complexity and enforce the best practices for managing time-series data.
|
||||
|
||||
With data streams, you can store append-only time-series data across multiple indices with a single endpoint for ingesting and searching data. It replaces index aliases for time-series data.
|
||||
|
||||
## About data streams
|
||||
|
||||
A data stream consists of one or more hidden auto-generated backing indices. These backing indices are named using the following convention:
|
||||
|
||||
```
|
||||
.ds-<data-stream-name>-<generation-id>
|
||||
```
|
||||
|
||||
For example, `.ds-logs-redis-000003`, where generation-id is a six-digit, zero-padded integer that acts as a cumulative count of the data stream’s rollovers, starting at `000001`.
|
||||
|
||||
The most recently created backing index is the data stream’s write index. You can’t add documents directly to any of the backing indices. You can only add them via the data stream handle:
|
||||
|
||||

|
||||
|
||||
The data stream routes search requests to all of its backing indices. It uses the timestamp field to intelligently route search requests to the right set of indices and shards:
|
||||
|
||||

|
||||
|
||||
The following operations are not supported on the write index because they might hinder the indexing operation:
|
||||
|
||||
- close
|
||||
- clone
|
||||
- delete
|
||||
- shrink
|
||||
- split
|
||||
|
||||
## Get started with data streams
|
||||
|
||||
### Step 1: Create an index template
|
||||
|
||||
To create a data stream, you first need to create an index template that configures a set of indices as a data stream. The `data_stream` object indicates that it’s a data stream and not a regular index template. The index pattern matches with the name of the data stream:
|
||||
|
||||
```json
|
||||
PUT _index_template/logs-template
|
||||
{
|
||||
"index_patterns": [
|
||||
"my-data-stream",
|
||||
"logs-*"
|
||||
],
|
||||
"data_stream": {},
|
||||
"priority": 100
|
||||
}
|
||||
```
|
||||
|
||||
In this case, each ingested document must have an `@timestamp` field.
|
||||
You also have the ability to define your own custom timestamp field as a property in the `data_stream` object. You can also add index mappings and other settings here, just as you would for a regular index template.
|
||||
|
||||
```json
|
||||
PUT _index_template/logs-template-nginx
|
||||
{
|
||||
"index_patterns": "logs-nginx",
|
||||
"data_stream": {
|
||||
"timestamp_field": {
|
||||
"name": "request_time"
|
||||
}
|
||||
},
|
||||
"priority": 200,
|
||||
"template": {
|
||||
"settings": {
|
||||
"number_of_shards": 1,
|
||||
"number_of_replicas": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
In this case, `logs-nginx` index matches both the `logs-template` and `logs-template-nginx` templates. When you have a tie, OpenSearch selects the matching index template with the higher priority value.
|
||||
|
||||
### Step 2: Create a data stream
|
||||
|
||||
After you create an index template, you can create a data stream.
|
||||
You can use the data stream API to explicitly create a data stream. The data stream API initializes the first backing index:
|
||||
|
||||
```json
|
||||
PUT _data_stream/logs-redis
|
||||
PUT _data_stream/logs-nginx
|
||||
```
|
||||
|
||||
You can also directly start ingesting data without creating a data stream.
|
||||
|
||||
Because we have a matching index template with a data_stream object, OpenSearch automatically creates the data stream:
|
||||
|
||||
```json
|
||||
POST logs-staging/_doc
|
||||
{
|
||||
"message": "login attempt failed",
|
||||
"@timestamp": "2013-03-01T00:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
To see information about a specific data stream:
|
||||
|
||||
```json
|
||||
GET _data_stream/logs-nginx
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"data_streams" : [
|
||||
{
|
||||
"name" : "logs-nginx",
|
||||
"timestamp_field" : {
|
||||
"name" : "request_time"
|
||||
},
|
||||
"indices" : [
|
||||
{
|
||||
"index_name" : ".ds-logs-nginx-000001",
|
||||
"index_uuid" : "-VhmuhrQQ6ipYCmBhn6vLw"
|
||||
}
|
||||
],
|
||||
"generation" : 1,
|
||||
"status" : "GREEN",
|
||||
"template" : "logs-template-nginx"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
You can see the name of the timestamp field, the list of the backing indices, and the template that's used to create the data stream. You can also see the health of the data stream, which represents the lowest status of all its backing indices.
|
||||
|
||||
To see more insights about the data stream, use the `_stats` endpoint:
|
||||
|
||||
```json
|
||||
GET _data_stream/logs-nginx/_stats
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"_shards" : {
|
||||
"total" : 1,
|
||||
"successful" : 1,
|
||||
"failed" : 0
|
||||
},
|
||||
"data_stream_count" : 1,
|
||||
"backing_indices" : 1,
|
||||
"total_store_size_bytes" : 208,
|
||||
"data_streams" : [
|
||||
{
|
||||
"data_stream" : "logs-nginx",
|
||||
"backing_indices" : 1,
|
||||
"store_size_bytes" : 208,
|
||||
"maximum_timestamp" : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Step 3: Ingest data into the data stream
|
||||
|
||||
To ingest data into a data stream, you can use the regular indexing APIs. Make sure every document that you index has a timestamp field. If you try to ingest a document that doesn't have a timestamp field, you get an error.
|
||||
|
||||
```json
|
||||
POST logs-redis/_doc
|
||||
{
|
||||
"message": "login attempt",
|
||||
"@timestamp": "2013-03-01T00:00:00"
|
||||
}
|
||||
```
|
||||
|
||||
### Step 4: Searching a data stream
|
||||
|
||||
You can search a data stream just like you search a regular index or an index alias.
|
||||
The search operation applies to all of the backing indices (all data present in the stream).
|
||||
|
||||
```json
|
||||
GET logs-redis/_search
|
||||
{
|
||||
"query": {
|
||||
"match": {
|
||||
"message": "login"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"took" : 514,
|
||||
"timed_out" : false,
|
||||
"_shards" : {
|
||||
"total" : 5,
|
||||
"successful" : 5,
|
||||
"skipped" : 0,
|
||||
"failed" : 0
|
||||
},
|
||||
"hits" : {
|
||||
"total" : {
|
||||
"value" : 1,
|
||||
"relation" : "eq"
|
||||
},
|
||||
"max_score" : 0.2876821,
|
||||
"hits" : [
|
||||
{
|
||||
"_index" : ".ds-logs-redis-000001",
|
||||
"_type" : "_doc",
|
||||
"_id" : "-rhVmXoBL6BAVWH3mMpC",
|
||||
"_score" : 0.2876821,
|
||||
"_source" : {
|
||||
"message" : "login attempt",
|
||||
"@timestamp" : "2013-03-01T00:00:00"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Step 5: Rollover a data stream
|
||||
|
||||
A rollover operation creates a new backing index that becomes the data stream’s new write index.
|
||||
|
||||
To perform manual rollover operation on the data stream:
|
||||
|
||||
```json
|
||||
POST logs-redis/_rollover
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged" : true,
|
||||
"shards_acknowledged" : true,
|
||||
"old_index" : ".ds-logs-redis-000001",
|
||||
"new_index" : ".ds-logs-redis-000002",
|
||||
"rolled_over" : true,
|
||||
"dry_run" : false,
|
||||
"conditions" : { }
|
||||
}
|
||||
```
|
||||
|
||||
If you now perform a `GET` operation on the `logs-redis` data stream, you see that the generation ID is incremented from 1 to 2.
|
||||
|
||||
You can also set up an [Index State Management (ISM) policy]({{site.url}}{{site.baseurl}}/ism/policies/) to automate the rollover process for the data stream.
|
||||
The ISM policy is applied to the backing indices at the time of their creation. When you associate a policy to a data stream, it only affects the future backing indices of that data stream.
|
||||
|
||||
You also don’t need to provide the `rollover_alias` setting, because the ISM policy infers this information from the backing index.
|
||||
|
||||
### Step 6: Manage data streams in OpenSearch Dashboards
|
||||
|
||||
To manage data streams from OpenSearch Dashboards, open **OpenSearch Dashboards**, choose **Index Management**, select **Indices** or **Policy managed indices**.
|
||||
|
||||
You see a toggle switch for data streams that you can use to show or hide indices belonging to a data stream.
|
||||
|
||||
When you enable this switch, you see a data stream multi-select dropdown menu that you can use for filtering data streams.
|
||||
You also see a data stream column that shows you the name of the parent data stream the index is contained in.
|
||||
|
||||

|
||||
|
||||
You can select one or more data streams and apply an ISM policy on them. You can also apply a policy on any individual backing index.
|
||||
|
||||
You can performing visualizations on a data stream just like you would on a regular index or index alias.
|
||||
|
||||
### Step 7: Delete a data stream
|
||||
|
||||
The delete operation first deletes the backing indices of a data stream and then deletes the data stream itself.
|
||||
|
||||
To delete a data stream and all of its hidden backing indices:
|
||||
|
||||
```json
|
||||
DELETE _data_stream/<name_of_data_stream>
|
||||
```
|
||||
|
||||
You can use wildcards to delete more than one data stream.
|
||||
|
||||
We recommend deleting data from a data stream using an ISM policy.
|
||||
|
||||
You can also use [asynchronous search]({{site.url}}{{site.baseurl}}/async/index/) and [SQL]({{site.url}}{{site.baseurl}}/sql/index/) and [PPL]({{site.url}}{{site.baseurl}}/ppl/index/) to query your data stream directly. You can also use the security plugin to define granular permissions on the data stream name.
|
||||
@@ -1,23 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Index templates
|
||||
nav_order: 14
|
||||
nav_order: 15
|
||||
---
|
||||
|
||||
# Index templates
|
||||
|
||||
Index templates let you initialize new indices with predefined mappings and settings. For example, if you continuously index log data, you can define an index template so that all of these indices have the same number of shards and replicas.
|
||||
|
||||
---
|
||||
|
||||
#### Table of contents
|
||||
1. TOC
|
||||
{:toc}
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Create a template
|
||||
### Create a template
|
||||
|
||||
To create an index template, use a POST request:
|
||||
|
||||
@@ -106,7 +97,7 @@ GET logs-2020-01-01
|
||||
|
||||
Any additional indices that match this pattern---`logs-2020-01-02`, `logs-2020-01-03`, and so on---will inherit the same mappings and settings.
|
||||
|
||||
## Retrieve a template
|
||||
### Retrieve a template
|
||||
|
||||
To list all index templates:
|
||||
|
||||
@@ -138,7 +129,7 @@ To check if a specific template exists:
|
||||
HEAD _index_template/<name>
|
||||
```
|
||||
|
||||
## Configure multiple templates
|
||||
### Configure multiple templates
|
||||
|
||||
You can create multiple index templates for your indices. If the index name matches more than one template, OpenSearch merges all mappings and settings from all matching templates and applies them to the index.
|
||||
|
||||
@@ -184,7 +175,7 @@ PUT _index_template/template-02
|
||||
|
||||
Because `template-02` has a higher `priority` value, it takes precedence over `template-01` . The `logs-2020-01-02` index would have the `number_of_shards` value as 3.
|
||||
|
||||
## Delete a template
|
||||
### Delete a template
|
||||
|
||||
You can delete an index template using its name:
|
||||
|
||||
@@ -192,11 +183,225 @@ You can delete an index template using its name:
|
||||
DELETE _index_template/daily_logs
|
||||
```
|
||||
|
||||
## Composable index templates
|
||||
|
||||
Managing multiple index templates has the following challenges:
|
||||
|
||||
- If you have duplication between index templates, storing these index templates results in a bigger cluster state.
|
||||
- If you want to make a change across all your index templates, you have to manually make the change for each template.
|
||||
- If an index matches multiple templates, OpenSearch might merge the templates in an unexpected way that you discover only after an index is created.
|
||||
|
||||
You can use composable index templates to overcome these challenges. Composable index templates let you abstract common settings, mappings, and aliases into a reusable building block called a component template.
|
||||
|
||||
You can combine component templates to compose an index template.
|
||||
|
||||
Settings and mappings that you specify directly in the [create index]({{site.url}}{{site.baseurl}}/opensearch/rest-api/create-index/) request override any settings or mappings specified in an index template and its component templates.
|
||||
{: .note }
|
||||
|
||||
### Create a component template
|
||||
|
||||
Let's define two component templates---`component_template_1` and `component_template_2`:
|
||||
|
||||
#### Component template 1
|
||||
|
||||
```json
|
||||
PUT _component_template/component_template_1
|
||||
{
|
||||
"template": {
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"@timestamp": {
|
||||
"type": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Component template 2
|
||||
|
||||
```json
|
||||
PUT _component_template/component_template_2
|
||||
{
|
||||
"template": {
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"ip_address": {
|
||||
"type": "ip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Use component templates to create an index template
|
||||
|
||||
When creating index templates, you need to include the component templates in a `composed_of` list.
|
||||
|
||||
OpenSearch applies the component templates in the order in which you specify them within the index template. The settings, mappings, and aliases that you specify inside the index template are applied last.
|
||||
|
||||
```json
|
||||
PUT _index_template/daily_logs
|
||||
{
|
||||
"index_patterns": [
|
||||
"logs-2020-01-*"
|
||||
],
|
||||
"template": {
|
||||
"aliases": {
|
||||
"my_logs": {}
|
||||
},
|
||||
"settings": {
|
||||
"number_of_shards": 2,
|
||||
"number_of_replicas": 1
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"timestamp": {
|
||||
"type": "date",
|
||||
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
|
||||
},
|
||||
"value": {
|
||||
"type": "double"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"priority": 200,
|
||||
"composed_of": [
|
||||
"component_template_1",
|
||||
"component_template_2"
|
||||
],
|
||||
"version": 3,
|
||||
"_meta": {
|
||||
"description": "using component templates"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you create an index named `logs-2020-01-01`, you can see that it derives its mappings and settings from both the component templates:
|
||||
|
||||
```json
|
||||
PUT logs-2020-01-01
|
||||
GET logs-2020-01-01
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
```json
|
||||
{
|
||||
"logs-2020-01-01": {
|
||||
"aliases": {
|
||||
"my_logs": {}
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"@timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"ip_address": {
|
||||
"type": "ip"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date",
|
||||
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
|
||||
},
|
||||
"value": {
|
||||
"type": "double"
|
||||
}
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"index": {
|
||||
"creation_date": "1625382479459",
|
||||
"number_of_shards": "2",
|
||||
"number_of_replicas": "1",
|
||||
"uuid": "rYUlpOXDSUSuZifQLPfa5A",
|
||||
"version": {
|
||||
"created": "7100299"
|
||||
},
|
||||
"provided_name": "logs-2020-01-01"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Simulate multi-component templates
|
||||
|
||||
For index templates composed of multiple component templates, you can simulate applying a new template to verify whether the settings are applied as you expect.
|
||||
|
||||
To simulate the settings that would be applied to a specific index name:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate_index/<index_name>
|
||||
```
|
||||
|
||||
To simulate the settings that would be applied from an existing template:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate/<index_template>
|
||||
```
|
||||
|
||||
You can also specify a template definition in the simulate request:
|
||||
|
||||
```json
|
||||
POST _index_template/_simulate
|
||||
{
|
||||
"index_patterns": [
|
||||
"logs-2020-01-*"
|
||||
],
|
||||
"template": {
|
||||
"settings" : {
|
||||
"index.number_of_shards" : 3
|
||||
}
|
||||
},
|
||||
"composed_of": ["component_template_1", "component_template_2"]
|
||||
}
|
||||
```
|
||||
|
||||
The `_simulate` API returns the final settings, mappings, and aliases that will be applied to indices that match the index pattern. You can also see any overlapping templates whose configuration is superseded by the simulated template body or higher priority templates:
|
||||
|
||||
```json
|
||||
{
|
||||
"template" : {
|
||||
"settings" : {
|
||||
"index" : {
|
||||
"number_of_shards" : "3"
|
||||
}
|
||||
},
|
||||
"mappings" : {
|
||||
"properties" : {
|
||||
"@timestamp" : {
|
||||
"type" : "date"
|
||||
},
|
||||
"ip_address" : {
|
||||
"type" : "ip"
|
||||
}
|
||||
}
|
||||
},
|
||||
"aliases" : { }
|
||||
},
|
||||
"overlapping" : [
|
||||
{
|
||||
"name" : "daily_logs",
|
||||
"index_patterns" : [
|
||||
"logs-2020-01-*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Index template options
|
||||
|
||||
You can specify the following template options:
|
||||
|
||||
Option | Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
`priority` | `Number` | The priority of the index template. | No
|
||||
`create` | `Boolean` | Whether this index template should replace an existing one. | No
|
||||
`template` | `Object` | Specify index settings, mappings, and aliases. | No
|
||||
`priority` | `Integer` | The priority of the index template. | No
|
||||
`composed_of` | `String array` | The names of component templates applied on a new index together with the current template. | No
|
||||
`version` | `Integer` | Specify a version number to simplify template management. Default is `null`. | No
|
||||
`_meta ` | `Object` | Specify meta information about the template. | No
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
layout: default
|
||||
title: Compatibility
|
||||
parent: Install OpenSearch
|
||||
nav_order: 2
|
||||
---
|
||||
|
||||
# Operating system and JVM compatibility
|
||||
|
||||
- We recommend installing OpenSearch on RHEL- or Debian-based Linux distributions that use [systemd](https://en.wikipedia.org/wiki/Systemd), such as CentOS, Amazon Linux 2, and Ubuntu (LTS). OpenSearch should work on many Linux distributions, but we only test a handful.
|
||||
- The OpenSearch tarball ships with a compatible version of Java in the `jdk` directory. To find its version, run `./jdk/bin/java -version`. For example, the OpenSearch 1.0.0 tarball ships with Java 15 (non-LTS).
|
||||
|
||||
{% comment %}`./jdk/bin/java -version` doesn't work on macOS with zsh at the moment, and I have no idea why. Maybe we need a macOS artifact. Regardless, the command works on Amazon Linux 2 with bash and presumably other distros. - aetter{% endcomment %}
|
||||
|
||||
To use a different Java installation, set the `OPENSEARCH_JAVA_HOME` environment variable to the Java install location. We recommend Java 11 (LTS), but OpenSearch also works with Java 8.
|
||||
|
||||
OpenSearch version | Compatible Java versions | Recommended operating systems
|
||||
:--- | :--- | :---
|
||||
1.x | 8, 11 | Red Hat Enterprise Linux 7, 8; CentOS 7, 8; Amazon Linux 2; Ubuntu 16.04, 18.04, 20.04
|
||||
@@ -7,10 +7,11 @@ nav_order: 5
|
||||
|
||||
# Docker security configuration
|
||||
|
||||
Before deploying to a production environment, you should replace the demo security certificates and configuration YAML files with your own. With the tarball, you have direct access to the file system, but the Docker image requires modifying the Docker storage volumes include the replacement files.
|
||||
Before deploying to a production environment, you should replace the demo security certificates and configuration YAML files with your own. With the tarball, you have direct access to the file system, but the Docker image requires modifying the Docker storage volumes to include the replacement files.
|
||||
|
||||
Additionally, you can set the Docker environment variable `DISABLE_INSTALL_DEMO_CONFIG` to `true`. This change completely disables the demo installer.
|
||||
|
||||
|
||||
## Sample Docker Compose file
|
||||
|
||||
```yml
|
||||
@@ -93,8 +94,7 @@ services:
|
||||
expose:
|
||||
- "5601"
|
||||
environment:
|
||||
OPENSEARCH_URL: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # must be a string with no spaces when specified as an environment variable
|
||||
volumes:
|
||||
- ./custom-opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
|
||||
networks:
|
||||
@@ -142,6 +142,7 @@ If you encounter any `File /usr/share/opensearch/config/opensearch.yml has insec
|
||||
|
||||
Finally, you can reach OpenSearch Dashboards at http://localhost:5601, sign in, and use the **Security** panel to perform other management tasks.
|
||||
|
||||
|
||||
## Using certificates with Docker
|
||||
|
||||
To use your own certificates in your configuration, add all of the necessary certificates to the volumes section of the Docker Compose file:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
layout: default
|
||||
title: Docker
|
||||
parent: Install OpenSearch
|
||||
nav_order: 1
|
||||
nav_order: 3
|
||||
---
|
||||
|
||||
# Docker image
|
||||
@@ -16,7 +16,7 @@ docker pull opensearchproject/opensearch-dashboards:{{site.opensearch_version}}
|
||||
|
||||
To check available versions, see [Docker Hub](https://hub.docker.com/u/opensearchproject).
|
||||
|
||||
OpenSearch images use `centos:7` as the base image. If you run Docker locally, we recommend allowing Docker to use at least 4 GB of RAM in **Preferences** > **Resources**.
|
||||
OpenSearch images use `amazonlinux:2` as the base image. If you run Docker locally, set Docker to use at least 4 GB of RAM in **Preferences** > **Resources**.
|
||||
|
||||
|
||||
---
|
||||
@@ -138,7 +138,7 @@ services:
|
||||
expose:
|
||||
- "5601"
|
||||
environment:
|
||||
OPENSEARCH_HOSTS: https://opensearch-node1:9200
|
||||
OPENSEARCH_HOSTS: '["https://opensearch-node1:9200","https://opensearch-node2:9200"]' # must be a string with no spaces when specified as an environment variable
|
||||
networks:
|
||||
- opensearch-net
|
||||
|
||||
@@ -150,7 +150,7 @@ networks:
|
||||
opensearch-net:
|
||||
```
|
||||
|
||||
If you override `opensearch_dashboards.yml` settings using environment variables, as seen above, use all uppercase letters and periods in place of underscores (e.g. for `opensearch.url`, specify `OPENSEARCH_URL`).
|
||||
If you override `opensearch_dashboards.yml` settings using environment variables, as seen above, use all uppercase letters and periods in place of underscores (e.g. for `opensearch.hosts`, use `OPENSEARCH_HOSTS`).
|
||||
{: .note}
|
||||
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ nav_order: 60
|
||||
The OpenSearch logs include valuable information for monitoring cluster operations and troubleshooting issues. The location of the logs differs based on the installation type:
|
||||
|
||||
- On Docker, OpenSearch writes most logs to the console and stores the remainder in `opensearch/logs/`. The tarball installation also uses `opensearch/logs/`.
|
||||
- On the RPM and Debian installations, OpenSearch writes logs to `/var/log/opensearch/`.
|
||||
- On most Linux installations, OpenSearch writes logs to `/var/log/opensearch/`.
|
||||
|
||||
Logs are available as `.log` (plain text) and `.json` files.
|
||||
Logs are available as `.log` (plain text) and `.json` files. Permissions for the OpenSearch logs are `-rw-r--r--` by default, meaning that any user account on the node can read them. You can change this behavior _for each log type_ in `log4j2.properties` using the `filePermissions` option. For example, you might add `appender.rolling.filePermissions = rw-r-----` to change permissions for the JSON server log. For details, see the [Log4j 2 documentation](https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender).
|
||||
|
||||
|
||||
## Application logs
|
||||
|
||||
@@ -6,7 +6,7 @@ nav_order: 96
|
||||
|
||||
# Popular APIs
|
||||
|
||||
This page contains sample requests for popular OpenSearch APIs.
|
||||
This page contains sample requests for popular OpenSearch operations.
|
||||
|
||||
|
||||
---
|
||||
@@ -80,7 +80,7 @@ POST _bulk
|
||||
## List all indices
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
GET _cat/indices?v&expand_wildcards=all
|
||||
```
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ PUT _snapshot/my-repository/my-snapshot
|
||||
```json
|
||||
POST _snapshot/my-repository/my-snapshot/_restore
|
||||
{
|
||||
"indices": "-.opensearch_security",
|
||||
"indices": "-.opendistro_security",
|
||||
"include_global_state": false
|
||||
}
|
||||
```
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat aliases
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat aliases
|
||||
|
||||
The cat aliases operation lists the mapping of aliases to indices, plus routing and filtering information.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/aliases?v
|
||||
```
|
||||
|
||||
To limit the information to a specific alias, add the alias name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/<alias>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one alias, separate the alias names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/alias1,alias2,alias3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/aliases/<alias>
|
||||
GET _cat/aliases
|
||||
```
|
||||
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat aliases URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows that `alias1` refers to a `movies` index and has a configured filter:
|
||||
|
||||
```json
|
||||
alias | index | filter | routing.index | routing.search | is_write_index
|
||||
alias1 | movies | * | - | - | -
|
||||
.kibana | .kibana_1 | - | - | - | -
|
||||
```
|
||||
|
||||
To learn more about index aliases, see [Index aliases]({{site.url}}{{site.baseurl}}/opensearch/index-alias).
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat allocation
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 5
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat allocation
|
||||
|
||||
The cat allocation operation lists the allocation of disk space for indices and the number of shards on each node.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/allocation?v
|
||||
```
|
||||
|
||||
To limit the information to a specific node, add the node name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/allocation/<node_name>
|
||||
```
|
||||
|
||||
If you want to get information for more than one node, separate the node names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/node_name_1,node_name_2,node_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/allocation?v
|
||||
GET _cat/allocation/<node_name>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat allocation URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows that 8 shards are allocated to each the two nodes available:
|
||||
|
||||
```json
|
||||
shards | disk.indices | disk.used | disk.avail | disk.total | disk.percent host | ip | node
|
||||
8 | 989.4kb | 25.9gb | 32.4gb | 58.4gb | 44 172.18.0.4 | 172.18.0.4 | odfe-node1
|
||||
8 | 962.4kb | 25.9gb | 32.4gb | 58.4gb | 44 172.18.0.3 | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat count
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 10
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat count
|
||||
|
||||
The cat count operation lists the number of documents in your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/count?v
|
||||
```
|
||||
|
||||
To see the number of documents in a specific index or alias, add the index or alias name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/count/<index_or_alias>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index or alias, separate the index or alias names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index_or_alias_1,index_or_alias_2,index_or_alias_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/count?v
|
||||
GET _cat/count/<index>?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat count URL parameters are optional. You can specify any of the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows the overall document count as 1625:
|
||||
|
||||
```json
|
||||
epoch | timestamp | count
|
||||
1624237738 | 01:08:58 | 1625
|
||||
```
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat field data
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 15
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat fielddata
|
||||
|
||||
The cat fielddata operation lists the memory size used by each field per node.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/fielddata?v
|
||||
```
|
||||
|
||||
To limit the information to a specific field, add the field name after your query:
|
||||
|
||||
```json
|
||||
GET _cat/fielddata/<field_name>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one field, separate the field names with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/field_name_1,field_name_2,field_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/fielddata?v
|
||||
GET _cat/fielddata/<field_name>?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat fielddata URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
## Response
|
||||
|
||||
The following response shows the memory size for all fields as 284 bytes:
|
||||
|
||||
```json
|
||||
id host ip node field size
|
||||
1vo54NuxSxOrbPEYdkSF0w 172.18.0.4 172.18.0.4 odfe-node1 _id 284b
|
||||
ZaIkkUd4TEiAihqJGkp5CA 172.18.0.3 172.18.0.3 odfe-node2 _id 284b
|
||||
```
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat health
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 20
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat health
|
||||
|
||||
The cat health operation lists the status of the cluster, how long the cluster has been up, the number of nodes, and other useful information that helps you analyze the health of your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/health?v
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat health URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
ts | Boolean | If true, returns HH:MM:SS and Unix epoch timestamps. Default is true.
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
GET _cat/health?v&time=5d
|
||||
|
||||
epoch | timestamp | cluster | status | node.total | node.data | shards | pri | relo | init | unassign | pending_tasks | max_task_wait_time | active_shards_percent
|
||||
1624248112 | 04:01:52 | odfe-cluster | green | 2 | 2 | 16 | 8 | 0 | 0 | 0 | 0 | - | 100.0%
|
||||
```
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat indices
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 25
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat indices
|
||||
|
||||
The cat indices operation lists information related to indices—how much disk space they are using, how many shards they have, their health status, and so on.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/indices?v
|
||||
```
|
||||
|
||||
To limit the information to a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/indices/<index>
|
||||
GET _cat/indices
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat indices URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
health | String | Limit indices based on their health status. Supported values are `green`, `yellow`, and `red`.
|
||||
include_unloaded_segments | Boolean | Whether to include information from segments not loaded into memory. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
pri | Boolean | Whether to return information only from the primary shards. Default is false.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
health | status | index | uuid | pri | rep | docs.count | docs.deleted | store.size | pri.store.size
|
||||
green | open | movies | UZbpfERBQ1-3GSH2bnM3sg | 1 | 1 | 1 | 0 | 7.7kb | 3.8kb
|
||||
```
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat master
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 30
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat master
|
||||
|
||||
The cat master operation lists information that helps identify the elected master node.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/master?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/master
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat master URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
id | host | ip | node
|
||||
ZaIkkUd4TEiAihqJGkp5CA | 172.18.0.3 | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat nodeattrs
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 35
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat nodeattrs
|
||||
|
||||
The cat nodeattrs operation lists the attributes of custom nodes.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/nodeattrs
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodeattrs URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
node | host | ip | attr | value
|
||||
odfe-node2 | 172.18.0.3 | 172.18.0.3 | testattr | test
|
||||
```
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat nodes
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 40
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat nodes
|
||||
|
||||
The cat nodes operation lists node-level information, including node roles and load metrics.
|
||||
|
||||
A few important node metrics are `pid`, `name`, `master`, `ip`, `port`, `version`, `build`, `jdk`, along with `disk`, `heap`, `ram`, and `file_desc`.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/nodes?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/nodes
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodes URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
full_id | Boolean | If true, return the full node ID. If false, return the shortened node ID. Defaults to false.
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
include_unloaded_segments | Boolean | Whether to include information from segments not loaded into memory. Default is false.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
ip | heap.percent | ram.percent | cpu load_1m | load_5m | load_15m | node.role | master | name
|
||||
172.18.0.3 | 31 | 97 | 3 | 0.03 | 0.10 | 0.14 dimr | * | odfe-node2
|
||||
172.18.0.4 | 45 | 97 | 3 | 0.19 | 0.14 | 0.15 dimr | - | odfe-node1
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat pending tasks
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 45
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat pending tasks
|
||||
|
||||
The cat pending tasks operation lists the progress of all pending tasks, including task priority and time in queue.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/pending_tasks
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat nodes URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
insertOrder | timeInQueue | priority | source
|
||||
1786 | 1.8s | URGENT | shard-started
|
||||
```
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat plugins
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat plugins
|
||||
|
||||
The cat plugins operation lists the names, components, and versions of the installed plugins.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/plugins?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/plugins
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat plugins URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
name component version
|
||||
odfe-node2 opendistro-alerting 1.13.1.0
|
||||
odfe-node2 opendistro-anomaly-detection 1.13.0.0
|
||||
odfe-node2 opendistro-asynchronous-search 1.13.0.1
|
||||
odfe-node2 opendistro-index-management 1.13.2.0
|
||||
odfe-node2 opendistro-job-scheduler 1.13.0.0
|
||||
odfe-node2 opendistro-knn 1.13.0.0
|
||||
odfe-node2 opendistro-performance-analyzer 1.13.0.0
|
||||
odfe-node2 opendistro-reports-scheduler 1.13.0.0
|
||||
odfe-node2 opendistro-sql 1.13.2.0
|
||||
odfe-node2 opendistro_security 1.13.1.0
|
||||
odfe-node1 opendistro-alerting 1.13.1.0
|
||||
odfe-node1 opendistro-anomaly-detection 1.13.0.0
|
||||
odfe-node1 opendistro-asynchronous-search 1.13.0.1
|
||||
odfe-node1 opendistro-index-management 1.13.2.0
|
||||
odfe-node1 opendistro-job-scheduler 1.13.0.0
|
||||
odfe-node1 opendistro-knn 1.13.0.0
|
||||
odfe-node1 opendistro-performance-analyzer 1.13.0.0
|
||||
odfe-node1 opendistro-reports-scheduler 1.13.0.0
|
||||
odfe-node1 opendistro-sql 1.13.2.0
|
||||
odfe-node1 opendistro_security 1.13.1.0
|
||||
```
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat recovery
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 50
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat recovery
|
||||
|
||||
The cat recovery operation lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/recovery?v
|
||||
```
|
||||
|
||||
To see only the recoveries of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/recovery/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```json
|
||||
GET _cat/aliases/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/recovery
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat recovery URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
active_only | Boolean | Whether to only include ongoing shard recoveries. Default is false.
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
detailed | Boolean | Whether to include detailed information about shard recoveries. Default is false.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | time | type | stage | source_host | source_node | target_host | target_node | repository | snapshot | files | files_recovered | files_percent | files_total | bytes | bytes_recovered | bytes_percent | bytes_total | translog_ops | translog_ops_recovered | translog_ops_percent
|
||||
movies | 0 | 117ms | empty_store | done | n/a | n/a | 172.18.0.4 | odfe-node1 | n/a | n/a | 0 | 0 | 0.0% | 0 | 0 | 0 | 0.0% | 0 | 0 | 0 | 100.0%
|
||||
movies | 0 | 382ms | peer | done | 172.18.0.4 | odfe-node1 | 172.18.0.3 | odfe-node2 | n/a | n/a | 1 | 1 | 100.0% | 1 | 208 | 208 | 100.0% | 208 | 1 | 1 | 100.0%
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat repositories
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 55
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat repositories
|
||||
|
||||
The cat repositories operation lists all completed and ongoing index and shard recoveries.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/repositories?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/repositories
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat repositories URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameters:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
id type
|
||||
repo1 fs
|
||||
repo2 s3
|
||||
```
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat segments
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 55
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat segments
|
||||
|
||||
The cat segments operation lists Lucene segment-level information for each index.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/segments?v
|
||||
```
|
||||
|
||||
To see only the information about segments of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/segments/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```
|
||||
GET _cat/segments/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/segments
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat segments URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/)..
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | ip | segment | generation | docs.count | docs.deleted | size | size.memory | committed | searchable | version | compound
|
||||
movies | 0 | p | 172.18.0.4 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
|
||||
movies | 0 | r | 172.18.0.3 | _0 | 0 | 1 | 0 | 3.5kb | 1364 | true | true | 8.7.0 | true
|
||||
```
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat shards
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 60
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat shards
|
||||
|
||||
The cat shards operation lists the state of all primary and replica shards and how they are distributed.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/shards?v
|
||||
```
|
||||
|
||||
To see only the information about shards of a specific index, add the index name after your query.
|
||||
|
||||
```
|
||||
GET _cat/shards/<index>?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one index, separate the indices with commas:
|
||||
|
||||
```
|
||||
GET _cat/shards/index1,index2,index3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/shards
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat shards URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
bytes | Byte size | Specify the units for byte size. For example, `7kb` or `6gb`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | state | docs | store | ip | | node
|
||||
plugins | 0 | p | STARTED | 0 | 208b | 172.18.0.4 | odfe-node1
|
||||
plugins | 0 | r | STARTED | 0 | 208b | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat snapshots
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 65
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat snapshots
|
||||
|
||||
The cat snapshots operation lists all snapshots for a repository.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/snapshots?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/snapshots
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat snapshots URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
index | shard | prirep | state | docs | store | ip | | node
|
||||
plugins | 0 | p | STARTED | 0 | 208b | 172.18.0.4 | odfe-node1
|
||||
plugins | 0 | r | STARTED | 0 | 208b | 172.18.0.3 | odfe-node2
|
||||
```
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat tasks
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat tasks
|
||||
|
||||
The cat tasks operation lists the progress of all tasks currently running on your cluster.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/tasks?v
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/tasks
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat tasks URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
nodes | List | A comma-separated list of node IDs or names to limit the returned information. Use `_local` to return information from the node you're connecting to, specify the node name to get information from specific nodes, or keep the parameter empty to get information from all nodes.
|
||||
detailed | Boolean | Returns detailed task information. (Default: false)
|
||||
parent_task_id | String | Returns tasks with a specified parent task ID (node_id:task_number). Keep empty or set to -1 to return all.
|
||||
time | Time | Specify the units for time. For example, `5d` or `7h`. For more information, see [Supported units]({{site.url}}{{site.baseurl}}/opensearch/units/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
action | task_id | parent_task_id | type | start_time | timestamp | running_time | ip | node
|
||||
cluster:monitor/tasks/lists | 1vo54NuxSxOrbPEYdkSF0w:168062 | - | transport | 1624337809471 | 04:56:49 | 489.5ms | 172.18.0.4 | odfe-node1
|
||||
```
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat templates
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 70
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat templates
|
||||
|
||||
The cat templates operation lists the names, patterns, order numbers, and version numbers of index templates.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/templates?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one template, separate the template names with commas:
|
||||
|
||||
```
|
||||
GET _cat/shards/template_name_1,template_name_2,template_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/templates
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat templates URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```
|
||||
name | index_patterns order version composed_of
|
||||
tenant_template | [kibana*] | 0 |
|
||||
```
|
||||
|
||||
To learn more about index templates, see [Index templates]({{site.url}}{{site.baseurl}}/opensearch/index-templates).
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
layout: default
|
||||
title: cat thread pool
|
||||
parent: CAT
|
||||
grand_parent: REST API reference
|
||||
nav_order: 75
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# cat thread pool
|
||||
|
||||
The cat thread pool operation lists the active, queued, and rejected threads of different thread pools on each node.
|
||||
|
||||
## Example
|
||||
|
||||
```
|
||||
GET _cat/thread_pool?v
|
||||
```
|
||||
|
||||
If you want to get information for more than one thread pool, separate the thread pool names with commas:
|
||||
|
||||
```
|
||||
GET _cat/v/thread_pool_name_1,thread_pool_name_2,thread_pool_name_3
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cat/thread_pool
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cat thread pool URL parameters are optional.
|
||||
|
||||
In addition to the [common URL parameters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/cat/index#common-url-parameters), you can specify the following parameter:
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
node_name name active queue rejected
|
||||
odfe-node2 ad-batch-task-threadpool 0 0 0
|
||||
odfe-node2 ad-threadpool 0 0 0
|
||||
odfe-node2 analyze 0 0 0s
|
||||
```
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
layout: default
|
||||
title: CAT
|
||||
parent: REST API reference
|
||||
nav_order: 100
|
||||
has_children: true
|
||||
redirect_from:
|
||||
- /opensearch/catapis/
|
||||
---
|
||||
|
||||
# cat API
|
||||
|
||||
You can get essential statistics about your cluster in an easy-to-understand, tabular format using the compact and aligned text (CAT) API. The cat API is a human-readable interface that returns plain text instead of traditional JSON.
|
||||
|
||||
Using the cat API, you can answer questions like which node is the elected master, what state is the cluster in, how many documents are in each index, and so on.
|
||||
|
||||
## Example
|
||||
|
||||
To see the available operations in the cat API, use the following command:
|
||||
|
||||
```
|
||||
GET _cat
|
||||
```
|
||||
|
||||
## Common URL parameters
|
||||
|
||||
You can use the following string parameters with your query.
|
||||
|
||||
Parameter | Description
|
||||
:--- | :--- |
|
||||
`?v` | Makes the output more verbose by adding headers to the columns. It also adds some formatting to help align each of the columns together. All examples in this section include the `v` parameter.
|
||||
`?help` | Lists the default and other available headers for a given operation.
|
||||
`?h` | Limits the output to specific headers.
|
||||
`?format` | Outputs the result in JSON, YAML, or CBOR formats.
|
||||
`?sort` | Sorts the output by the specified columns.
|
||||
|
||||
To see what each column represents, use the `?v` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?v
|
||||
```
|
||||
|
||||
To see all the available headers, use the `?help` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?help
|
||||
```
|
||||
|
||||
To limit the output to a subset of headers, use the `?h` parameter:
|
||||
|
||||
```
|
||||
GET _cat/<operation_name>?h=<header_name_1>,<header_name_2>&v
|
||||
```
|
||||
|
||||
Typically, for any operation you can find out what headers are available using the `?help` parameter, and then use the `?h` parameter to limit the output to only the headers that you care about.
|
||||
|
||||
If you use the security plugin, make sure you have the appropriate permissions.
|
||||
{: .note }
|
||||
@@ -2,7 +2,7 @@
|
||||
layout: default
|
||||
title: Cluster allocation explain
|
||||
parent: REST API reference
|
||||
nav_order: 30
|
||||
nav_order: 10
|
||||
---
|
||||
|
||||
# Cluster allocation explain
|
||||
@@ -15,7 +15,7 @@ If you add some options, you can instead get information on a specific shard, in
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET /_cluster/allocation/explain?include_yes_decisions=true
|
||||
GET _cluster/allocation/explain?include_yes_decisions=true
|
||||
{
|
||||
"index": "movies",
|
||||
"shard": 0,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
layout: default
|
||||
title: Cluster health
|
||||
parent: REST API reference
|
||||
grand_parent: OpenSearch
|
||||
nav_order: 45
|
||||
nav_order: 15
|
||||
---
|
||||
|
||||
# Cluster health
|
||||
@@ -17,7 +16,7 @@ To get the status of a specific index, provide the index name.
|
||||
This request waits 50 seconds for the cluster to reach the yellow status or better:
|
||||
|
||||
```
|
||||
GET /_cluster/health?wait_for_status=yellow&timeout=50s
|
||||
GET _cluster/health?wait_for_status=yellow&timeout=50s
|
||||
```
|
||||
|
||||
If the cluster health becomes yellow or green before 50 seconds elapse, it returns a response immediately. Otherwise it returns a response as soon as it exceeds the timeout.
|
||||
@@ -25,8 +24,8 @@ If the cluster health becomes yellow or green before 50 seconds elapse, it retur
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET /_cluster/health
|
||||
GET /_cluster/health/<index>
|
||||
GET _cluster/health
|
||||
GET _cluster/health/<index>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
@@ -35,18 +34,18 @@ All cluster health parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
expand_wildcards | enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
level | enum | The level of detail for returned health information. Supported values are `cluster`, `indices`, and `shards`. Default is `cluster`.
|
||||
local | boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
timeout | time | The amount of time to wait for a response. If the timeout expires, the request fails. Default is 30 seconds.
|
||||
wait_for_active_shards | string | Wait until the specified number of shards is active before returning a response. `all` for all shards. Default is `0`.
|
||||
wait_for_events | enum | Wait until all currently queued events with the given priority are processed. Supported values are `immediate`, `urgent`, `high`, `normal`, `low`, and `languid`.
|
||||
wait_for_no_relocating_shards | boolean | Whether to wait until there are no relocating shards in the cluster. Default is false.
|
||||
wait_for_no_initializing_shards | boolean | Whether to wait until there are no initializing shards in the cluster. Default is false.
|
||||
wait_for_status | enum | Wait until the cluster is in a specific state or better. Supported values are `green`, `yellow`, and `red`.
|
||||
expand_wildcards | Enum | Expands wildcard expressions to concrete indices. Combine multiple values with commas. Supported values are `all`, `open`, `closed`, `hidden`, and `none`. Default is `open`.
|
||||
level | Enum | The level of detail for returned health information. Supported values are `cluster`, `indices`, and `shards`. Default is `cluster`.
|
||||
local | Boolean | Whether to return information from the local node only instead of from the master node. Default is false.
|
||||
master_timeout | Time | The amount of time to wait for a connection to the master node. Default is 30 seconds.
|
||||
timeout | Time | The amount of time to wait for a response. If the timeout expires, the request fails. Default is 30 seconds.
|
||||
wait_for_active_shards | String | Wait until the specified number of shards is active before returning a response. `all` for all shards. Default is `0`.
|
||||
wait_for_events | Enum | Wait until all currently queued events with the given priority are processed. Supported values are `immediate`, `urgent`, `high`, `normal`, `low`, and `languid`.
|
||||
wait_for_no_relocating_shards | Boolean | Whether to wait until there are no relocating shards in the cluster. Default is false.
|
||||
wait_for_no_initializing_shards | Boolean | Whether to wait until there are no initializing shards in the cluster. Default is false.
|
||||
wait_for_status | Enum | Wait until the cluster is in a specific state or better. Supported values are `green`, `yellow`, and `red`.
|
||||
|
||||
<!-- wait_for_nodes | string | Wait until the specified number of nodes is available. Also supports operators <=, >=, <, and >
|
||||
<!-- wait_for_nodes | string | Wait until the specified number of nodes is available. Also supports operators <=, >=, <, and >
|
||||
# Not working properly when tested -->
|
||||
|
||||
## Response
|
||||
@@ -69,4 +68,4 @@ wait_for_status | enum | Wait until the cluster is in a specific state or better
|
||||
"task_max_waiting_in_queue_millis" : 0,
|
||||
"active_shards_percent_as_number" : 100.0
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
layout: default
|
||||
title: Cluster settings
|
||||
parent: REST API reference
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# Cluster settings
|
||||
|
||||
The cluster settings operation lets you check the current settings for your cluster, review default settings, and change settings. When you update a setting using the API, OpenSearch applies it to all nodes in the cluster.
|
||||
|
||||
|
||||
## Examples
|
||||
|
||||
```json
|
||||
GET _cluster/settings?include_defaults=true
|
||||
```
|
||||
|
||||
```json
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"action": {
|
||||
"auto_create_index": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _cluster/settings
|
||||
PUT _cluster/settings
|
||||
```
|
||||
|
||||
|
||||
## URL parameters
|
||||
|
||||
All cluster settings parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
flat_settings | Boolean | Whether to return settings in the flat form, which can improve readability, especially for heavily nested settings. For example, the flat form of `"cluster": { "max_shards_per_node": 500 }` is `"cluster.max_shards_per_node": "500"`.
|
||||
include_defaults (GET only) | Boolean | Whether to include default settings as part of the response. This parameter is useful for identifying the names and current values of settings you want to update.
|
||||
master_timeout | Time | The amount of time to wait for a response from the master node. Default is 30 seconds.
|
||||
timeout (PUT only) | Time | The amount of time to wait for a response from the cluster. Default is 30 seconds.
|
||||
|
||||
|
||||
## Request body
|
||||
|
||||
The GET operation has no request body options.
|
||||
|
||||
For a PUT operation, the request body must contain `transient` or `persistent`, along with the setting you want to update:
|
||||
|
||||
```json
|
||||
PUT _cluster/settings
|
||||
{
|
||||
"persistent": {
|
||||
"cluster": {
|
||||
"max_shards_per_node": 500
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For more information about transient settings, persistent settings, and precedence, see [OpenSearch configuration]({{site.url}}{{site.baseurl}}/opensearch/configuration/).
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged": true,
|
||||
"persistent": {
|
||||
"cluster": {
|
||||
"max_shards_per_node": "500"
|
||||
}
|
||||
},
|
||||
"transient": {}
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
layout: default
|
||||
title: Alias
|
||||
parent: REST API reference
|
||||
grand_parent: OpenSearch
|
||||
nav_order: 8
|
||||
---
|
||||
|
||||
# Alias
|
||||
|
||||
An alias is a virtual pointer that you can use to reference one or more indices. Creating and updating aliases are atomic operations, so you can reindex your data and point an alias at it without any downtime.
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
POST _aliases
|
||||
{
|
||||
"actions": [
|
||||
{
|
||||
"add": {
|
||||
"index": "movies",
|
||||
"alias": "movies-alias1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"remove": {
|
||||
"index": "old-index",
|
||||
"alias": "old-index-alias"
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
POST _aliases
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All alias parameters are optional.
|
||||
|
||||
Parameter | Data Type | Description
|
||||
:--- | :--- | :---
|
||||
master_timeout | Time | The amount of time to wait for a response from the master node. Default is `30s`.
|
||||
timeout | Time | The amount of time to wait for a response from the cluster. Default is `30s`.
|
||||
|
||||
## Request body
|
||||
|
||||
In your request body, you need to specify what action to take, the alias name, and the index you want to associate with the alias. Other fields are optional.
|
||||
|
||||
Field | Data Type | Description | Required
|
||||
:--- | :--- | :--- | :---
|
||||
actions | Array | Set of actions you want to perform on the index. Valid options are: `add`, `remove`, and `remove_index`. You must have at least one action in the array. | Yes
|
||||
add | N/A | Adds an alias to the specified index. | No
|
||||
remove | N/A | Removes an alias from the specified index. | No
|
||||
remove_index | N/A | Deletes an index. | No
|
||||
index | String | Name of the index you want to associate with the alias. Supports wildcard expressions. | Yes if you don't supply an `indices` field in the body.
|
||||
indices | Array | Array of index names you want to associate with the alias. | Yes if you don't supply an `index` field in the body.
|
||||
alias | String | The name of the alias. | Yes if you don't supply an `aliases` field in the body.
|
||||
aliases | Array | Array of alias names. | Yes if you don't supply an `alias` field in the body.
|
||||
filter | Object | A filter to use with the alias, so the alias points to a filtered part of the index. | No
|
||||
is_hidden | Boolean | Specifies whether the alias should be hidden from results that include wildcard expressions | No
|
||||
must_exist | Boolean | Specifies whether the alias to remove must exist. | No
|
||||
is_write_index | Boolean | Specifies whether the index should be a write index. An alias can only have one write index at a time. | No
|
||||
routing | String | Used to assign a custom value to a shard for specific operations. | No
|
||||
index_routing | String | Assigns a custom value to a shard only for index operations. | No
|
||||
search_routing | String | Assigns a custom value to a shard only for search operations. | No
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
"acknowledged": true
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1,162 @@
|
||||
---
|
||||
layout: default
|
||||
title: Create index
|
||||
parent: REST API reference
|
||||
grand_parent: OpenSearch
|
||||
nav_order: 7
|
||||
---
|
||||
|
||||
# Create index
|
||||
|
||||
While you can create an index by using a document as a base, you can also just create an empty index for use later.
|
||||
|
||||
## Example
|
||||
|
||||
The following example demonstrates how to create an index with a non-default number of primary and replica shards, specifies that `age` is of type `integer`, and assigns a `sample-alias1` alias to the index.
|
||||
|
||||
```json
|
||||
PUT /sample-index1
|
||||
|
||||
{
|
||||
"settings": {
|
||||
"index": {
|
||||
"number_of_shards": 2,
|
||||
"number_of_replicas": 1
|
||||
}
|
||||
},
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"age": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"aliases": {
|
||||
"sample-alias1": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
PUT <index-name>
|
||||
```
|
||||
|
||||
## Index naming restrictions
|
||||
|
||||
OpenSearch indices have the following naming restrictions:
|
||||
|
||||
- All letters must be lowercase.
|
||||
- Index names can't begin with underscores (`_`) or hyphens (`-`).
|
||||
- Index names can't contain spaces, commas, or the following characters:
|
||||
|
||||
`:`, `"`, `*`, `+`, `/`, `\`, `|`, `?`, `#`, `>`, or `<`
|
||||
|
||||
## URL parameters
|
||||
|
||||
You can include the following URL parameters in your request. All parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
include_type_name | Boolean | If `true`, the request expects a type in the body of mappings. Because OpenSearch indices all have a type of `_doc`, we recommend that this parameter is left as the default of `false.`
|
||||
wait_for_active_shards | String | Specifies the number of active shards that must be available before OpenSearch processes the request. Default is 1 (only the primary shard). Set to `all` or a positive integer. Values greater than 1 require replicas. For example, if you specify a value of 3, the index must have two replicas distributed across two additional nodes for the request to succeed.
|
||||
master_timeout | Time | How long to wait for a connection to the master node. Default is `30s`.
|
||||
timeout | Time | How long to wait for the request to return. Default is `30s`.
|
||||
|
||||
## Request body
|
||||
|
||||
As part of your request, you can supply parameters in your request's body that specify index settings, mappings, and [aliases]({{site.url}}{{site.baseurl}}/opensearch/index-alias/) for your newly created index. The following sections provide more information about index settings and mappings.
|
||||
|
||||
|
||||
### Index settings
|
||||
|
||||
Index settings are separated into two varieties: static index settings and dynamic index settings. Static index settings are settings that you specify at index creation and can't change later. You can change dynamic settings at any time, including at index creation.
|
||||
|
||||
#### Static index settings
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
index.number_of_shards | The number of primary shards in the index. Default is 1.
|
||||
index.number_of_routing_shards | The number of routing shards used to split an index.
|
||||
index.shard.check_on_startup | Whether the index's shards should be checked for corruption. Available options are `false` (do not check for corruption), `checksum` (check for physical corruption), and `true` (check for both physical and logical corruption). Default is `false`.
|
||||
index.codec | The compression type to use to compress stored data. Available values are `best_compression` and `default`.
|
||||
index.routing_partition_size | The number of shards a custom routing value can go to. Routing helps an imbalanced cluster by relocating values to a subset of shards rather than just a single shard. To enable, set this value to greater than 1 but less than `index.number_of_shards`. Default is 1.
|
||||
index.soft_deletes_enabled | Whether to retain a history of operations performed on the index.
|
||||
index.soft_deletes.retention_lease.period | The maximum amount of time to retain a shard's history of operations. Default is `12h`.
|
||||
index.load_fixed_bitset_filters_eagerly | Indicates whether cached filters should be pre-loaded for nested queries. Available options are `true` and `false`. Default is `true`.
|
||||
index.hidden | Whether the index should be hidden. Hidden indices are not returned as part of queries that have wildcards. Available options are `true` and `false`. Default is `false`.
|
||||
|
||||
#### Dynamic index Settings
|
||||
|
||||
Setting | Description
|
||||
:--- | :---
|
||||
index.number_of_replicas | The number of replica shards each primary shard should have. For example, if you have 4 primary shards and set `index.number_of_replicas` to 3, the index has 12 replica shards. Default is 1.
|
||||
index.auto_expand_replicas | Automatically expands the number of replicas based on the amount of data nodes in the cluster. Specify a lower bound and upper limit (for example, 0-9), or `all` for the upper limit. For example, if you have 5 data nodes and set `index.auto_expand_replicas` to 0-3, then the cluster does not autoamtically add another replica shard. However, if you set this value to `0-all` and add 2 more nodes for a total of 7, the cluster will expand to now have 6 replica shards. Default is disabled.
|
||||
index.search.idle.after | Amount of time a shard should wait for a search or get request until it goes idle. Default is `30s`.
|
||||
index.refresh_interval | How often the index should refresh, which publishes its most recent changes and makes them available for searching. Can be set to `-1` to disable refreshing. Default is `1s`.
|
||||
index.max_result_window | The maximum value of `from` + `size` for searches to the index. `from` is the starting index to search from, and `size` is the amount of results to return. Default: 10000.
|
||||
index.max_inner_result_window | The maximum value of `from` + `size` for inner hits definitions and top hits aggregations to the index. `from` is the starting index to search from, and `size` is the amount of top hits to return. Default is 100.
|
||||
index.max_rescore_window | The maximum value of `window_size` for rescore requests to the index. Rescore requests reorder the index's documents and return a new score, which can be more precise. Default is the same as index.max_inner_result_window or 10000 by default.
|
||||
index.max_docvalue_fields_search | Maximum amount of `docvalue_fields` allowed in a query. Default is 100.
|
||||
index.max_script_fields | Maximum amount of `script_fields` allowed in a query. Default is 32.
|
||||
index.max_ngram_diff | Maximum allowed difference between `min_gram` and `max_gram` values for `NGramTokenizer` and `NGramTokenFilter`. Default is 1.
|
||||
index.max_shingle_diff | Maximum allowed difference between `max_shingle_size` and `min_shingle_size` for the `shingle` token filter. Default is 3.
|
||||
index.max_refresh_listeners | Maximum amount of refresh listeners available on the index's shards.
|
||||
index.analyze.max_token_count | Maximum amount of tokens that can return from the `_analyze` API operation. Default is 10000.
|
||||
index.highlight.max_analyzed_offset | The maximum amount of characters that will be analyzed in a highlight request. Default is 1000000.
|
||||
index.max_terms_count | The maximum amount of terms that can be used in a terms query. Default is 65536.
|
||||
index.max_regex_length | The maximum character length of regex that can be in a regexp query. Default is 1000.
|
||||
index.query.default_field | A field or list of fields that OpenSearch uses in queries in case a field isn't specified in the parameters.
|
||||
index.routing.allocation.enable | Specifies options for the index's shard allocation. Available options are `all` (allow shard allocation for all shards), `primaries` (allow shard allocation only for primary shards), `new_primaries` (allow shard allocaiton only for new primary shards), and `none` (do not allow shard allocation). Default is `all`.
|
||||
index.routing.rebalance.enable | Enables shard rebalancing for the index. Available options are `all` (allow shard rebalancing for all shards), `primaries`, (allow shard rebalancing only for primary shards), `replicas` (allow shard rebalancing only for replicas), and `none` (do not allow shard rebalancing). Default is `all`.
|
||||
index.gc_deletes | Amount of time to retain a deleted document's version number. Default is `60s`.
|
||||
index.default_pipeline | The default ingest node pipeline for the index. If the default pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name `_none` specifies that the index does not have an ingest pipeline.
|
||||
index.final_pipeline | The final ingest node pipeline for the index. If the final pipeline is set and the pipeline does not exist, then index requests fail. The pipeline name `_none` specifies that the index does not have an ingest pipeline.
|
||||
|
||||
### Mappings
|
||||
|
||||
Mappings define how a documents and its fields are stored and indexed. If you're just starting to build out your cluster and data, you may not know exactly how your data should be stored. In those cases, you can use dynamic mappings, which tell OpenSearch to dynamically add data and their fields. However, if you know exactly what types your data fall under and want to enforce that standard, then you can use explicit mappings.
|
||||
|
||||
For example, if you want to indicate that `year` should be of type `text` instead of an `integer`, and `age` should be an `integer`, you can do so with explicit mappings. Using dynamic mapping, OpenSearch might interpret both `year` and `age` as integers.
|
||||
|
||||
#### Dynamic mapping types
|
||||
|
||||
Type | Description
|
||||
:--- | :---
|
||||
null | A `null` field can't be indexed or searched. When a field is set to null, OpenSearch behaves as if that field has no values.
|
||||
boolean | OpenSearch accepts `true` and `false` as boolean values. An empty string is equal to `false.`
|
||||
float | A single-precision 32-bit floating point number.
|
||||
double | A double-precision 64-bit floating point number.
|
||||
integer | A signed 32-bit number.
|
||||
object | Objects are standard JSON objects, which can have fields and mappings of their own. For example, a `movies` object can have additional properties such as `title`, `year`, and `director`.
|
||||
array | Arrays in OpenSearch can only store values of one type, such as an array of just integers or strings. Empty arrays are treated as though they are fields with no values.
|
||||
text | A string sequence of characters that represent full-text values.
|
||||
keyword | A string sequence of structured characters, such as an email or ZIP code.
|
||||
date detection string | Enabled by default, if new string fields match a date's format, then the string is processed as a `date` field. For example, `date: "2012/03/11"` is processed as a date.
|
||||
numeric detection string | If disabled, OpenSearch may automatically process numeric values as strings when they should be processed as numbers. When enabled, OpenSearch can process strings into `long`, `integer`, `short`, `byte`, `double`, `float`, `half_float`, `scaled_float`, `unsigned_long`. Default is disabled.
|
||||
|
||||
#### Explicit mapping
|
||||
|
||||
If you know exactly what your data's typings need to be, you can specify them in your request body when creating your index.
|
||||
|
||||
```json
|
||||
{
|
||||
"mappings": {
|
||||
"properties": {
|
||||
"year": { "type" : "text" },
|
||||
"age": { "type" : "integer" },
|
||||
"director":{ "type" : "text" }
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"acknowledged": true,
|
||||
"shards_acknowledged": true,
|
||||
"index": "sample-index1"
|
||||
}
|
||||
```
|
||||
@@ -1,8 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: Bulk
|
||||
parent: REST API reference
|
||||
nav_order: 15
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 20
|
||||
---
|
||||
|
||||
# Bulk
|
||||
@@ -32,7 +33,7 @@ POST _bulk
|
||||
POST {index}/_bulk
|
||||
```
|
||||
|
||||
Specifying the index in the path means you don't need to include it in the [request body](#request-body).
|
||||
Specifying the index in the path means you don't need to include it in the [request body]({{site.url}}{{site.baseurl}}/opensearch/rest-api/document-apis/bulk/#request-body).
|
||||
|
||||
OpenSearch also accepts PUT requests to the `_bulk` path, but we highly recommend using POST. The accepted usage of PUT---adding or replacing a single resource at a given path---doesn't make sense for bulk requests.
|
||||
{: .note }
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
layout: default
|
||||
title: Get document
|
||||
parent: Document APIs
|
||||
grand_parent: REST API reference
|
||||
nav_order: 5
|
||||
---
|
||||
|
||||
# Get document
|
||||
|
||||
After adding a JSON document to your index, you can use the get document API operation to retrieve the document's information and data.
|
||||
|
||||
## Example
|
||||
|
||||
```json
|
||||
GET sample-index1/_doc/1
|
||||
```
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET <index>/_doc/<_id>
|
||||
HEAD <index>/_doc/<_id>
|
||||
```
|
||||
```
|
||||
GET <index>/_source/<_id>
|
||||
HEAD <index>/_source/<_id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All get document URL parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
preference | string | Specifies a preference of which shard to retrieve results from. Available options are `_local`, which tells the operation to retrieve results from a locally allocated shard replica, and a custom string value assigned to a specific shard replica. By default, OpenSearch executes get document operations on random shards.
|
||||
realtime | boolean | Specifies whether the operation should run in realtime. If false, the operation waits for the index to refresh to analyze the source to retrieve data, which makes the operation near-realtime. Default is true.
|
||||
refresh | boolean | If true, OpenSearch refreshes shards to make the operation visible to searching. Default is false.
|
||||
routing | string | A value used to route the operation to a specific shard.
|
||||
stored_fields | boolean | If true, the operation retrieves document fields stored in the index rather than the document's `_source`. Default is false.
|
||||
_source | string | Whether to include the `_source` field in the response body. Default is true.
|
||||
_source_excludes | string | A comma-separated list of source fields to exclude in the query response.
|
||||
_source_includes | string | A comma-separated list of source fields to include in the query response.
|
||||
version | integer | The version of the document to return, which must match the current version of the document.
|
||||
version_type | enum | Retrieves a specifically typed document. Available options are `external` (retrieve the document if the specified version number is greater than the document's current version) and `external_gte` (retrieve the document if the specified version number is greater than or equal to the document's current verison). For example, to retrieve version 3 of a document, use `/_doc/1?version=3&version_type=external`.
|
||||
|
||||
|
||||
## Response
|
||||
```json
|
||||
{
|
||||
"_index": "sample-index1",
|
||||
"_type": "_doc",
|
||||
"_id": "1",
|
||||
"_version": 1,
|
||||
"_seq_no": 0,
|
||||
"_primary_term": 9,
|
||||
"found": true,
|
||||
"_source": {
|
||||
"text": "This is just some sample text."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Response body fields
|
||||
|
||||
Field | Description
|
||||
:--- | :---
|
||||
_index | The name of the index.
|
||||
_type | The document's type. OpenSearch only supports one type, which is `_doc`.
|
||||
_id | The document's id.
|
||||
_version | The document's version number. Updated whenever the document changes.
|
||||
_seq_no | The sequnce number assigned when the document is indexed.
|
||||
primary_term | The primary term assigned when the document is indexed.
|
||||
found | Whether the document exists.
|
||||
_routing | The shard that the document is routed to. If the document is not routed to a particular shard, this field is omitted.
|
||||
_source | Contains the document's data if `found` is true. If `_source` is set to false or `stored_fields` is set to true in the URL parameters, this field is omitted.
|
||||
_fields | Contains the document's data that's stored in the index. Only returned if both `stored_fields` and `found` are true.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
layout: default
|
||||
title: Document APIs
|
||||
parent: REST API reference
|
||||
has_children: true
|
||||
nav_order: 7
|
||||
---
|
||||
|
||||
# Document APIs
|
||||
|
||||
The document APIs allow you to handle documents relative to your index, such as adding, updating, and deleting documents.
|
||||
|
||||
Document APIs are separated into two categories: single document operations and multi-document operations. Multi-document operations offer performance advantages over submitting many individual requests, so whenever practical, we recommend that you use multi-document operations.
|
||||
|
||||
## Single document operations
|
||||
|
||||
- Index
|
||||
- Get
|
||||
- Delete
|
||||
- Update
|
||||
|
||||
## Multi-document operations
|
||||
|
||||
- Bulk
|
||||
- Multi get
|
||||
- Delete by query
|
||||
- Update by query
|
||||
- Reindex
|
||||
@@ -0,0 +1,108 @@
|
||||
---
|
||||
layout: default
|
||||
title: Scroll
|
||||
parent: REST API reference
|
||||
nav_order: 120
|
||||
---
|
||||
|
||||
# Scroll
|
||||
|
||||
You can use the `scroll` operation to retrieve a large number of results. For example, for machine learning jobs, you can request an unlimited number of results in batches.
|
||||
|
||||
To use the `scroll` operation, add a `scroll` parameter to the request header with a search context to tell OpenSearch how long you need to keep scrolling. This search context needs to be long enough to process a single batch of results.
|
||||
|
||||
Because search contexts consume a lot of memory, we suggest you don't use the `scroll` operation for frequent user queries. Instead, use the `sort` parameter with the `search_after` parameter to scroll responses for user queries.
|
||||
{: .note }
|
||||
|
||||
## Example
|
||||
|
||||
To set the number of results that you want returned for each batch, use the `size` parameter:
|
||||
|
||||
```json
|
||||
GET shakespeare/_search?scroll=10m
|
||||
{
|
||||
"size": 10000
|
||||
}
|
||||
```
|
||||
|
||||
OpenSearch caches the results and returns a scroll ID to access them in batches:
|
||||
|
||||
```json
|
||||
"_scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAUWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ=="
|
||||
```
|
||||
|
||||
Pass this scroll ID to the `scroll` operation to get back the next batch of results:
|
||||
|
||||
```json
|
||||
GET _search/scroll
|
||||
{
|
||||
"scroll": "10m",
|
||||
"scroll_id": "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAUWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ=="
|
||||
}
|
||||
```
|
||||
|
||||
Using this scroll ID, you get results in batches of 10,000 as long as the search context is still open. Typically, the scroll ID does not change between requests, but it *can* change, so make sure to always use the latest scroll ID. If you don't send the next scroll request within the set search context, the `scroll` operation does not return any results.
|
||||
|
||||
If you expect billions of results, use a sliced scroll. Slicing allows you to perform multiple scroll operations for the same request, but in parallel.
|
||||
Set the ID and the maximum number of slices for the scroll:
|
||||
|
||||
```json
|
||||
GET shakespeare/_search?scroll=10m
|
||||
{
|
||||
"slice": {
|
||||
"id": 0,
|
||||
"max": 10
|
||||
},
|
||||
"query": {
|
||||
"match_all": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
With a single scroll ID, you get back 10 results.
|
||||
You can have up to 10 IDs.
|
||||
|
||||
Close the search context when you’re done scrolling, because the `scroll` operation continues to consume computing resources until the timeout:
|
||||
|
||||
```json
|
||||
DELETE _search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAcWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ==
|
||||
```
|
||||
|
||||
To close all open scroll contexts:
|
||||
|
||||
```json
|
||||
DELETE _search/scroll/_all
|
||||
```
|
||||
|
||||
The `scroll` operation corresponds to a specific timestamp. It doesn't consider documents added after that timestamp as potential results.
|
||||
|
||||
|
||||
## Path and HTTP methods
|
||||
|
||||
```
|
||||
GET _search/scroll
|
||||
POST _search/scroll
|
||||
```
|
||||
```
|
||||
GET _search/scroll/<scroll-id>
|
||||
POST _search/scroll/<scroll-id>
|
||||
```
|
||||
|
||||
## URL parameters
|
||||
|
||||
All scroll parameters are optional.
|
||||
|
||||
Parameter | Type | Description
|
||||
:--- | :--- | :---
|
||||
scroll | Time | Specifies the amount of time the search context is maintained.
|
||||
scroll_id | String | The scroll ID for the search.
|
||||
rest_total_hits_as_int | Boolean | Whether the `hits.total` property is returned as an integer or an object. Default is false.
|
||||
|
||||
## Response
|
||||
|
||||
```json
|
||||
{
|
||||
"succeeded": true,
|
||||
"num_freed": 1
|
||||
}
|
||||
```
|
||||
@@ -1,10 +1,13 @@
|
||||
---
|
||||
layout: default
|
||||
title: Tasks API
|
||||
nav_order: 25
|
||||
title: Tasks
|
||||
parent: REST API reference
|
||||
nav_order: 80
|
||||
redirect_from:
|
||||
- /opensearch/tasksapi/
|
||||
---
|
||||
|
||||
# Tasks API operation
|
||||
# Tasks
|
||||
|
||||
A task is any operation you run in a cluster. For example, searching your data collection of books for a title or author name is a task. When you run OpenSearch, a task is automatically created to monitor your cluster's health and performance. For more information about all of the tasks currently executing in your cluster, you can use the `tasks` API operation.
|
||||
|
||||
@@ -362,19 +362,19 @@ Snapshots are only forward-compatible by one major version. If you have an old s
|
||||
If you're using the security plugin, snapshots have some additional restrictions:
|
||||
|
||||
- To perform snapshot and restore operations, users must have the built-in `manage_snapshots` role.
|
||||
- You can't restore snapshots that contain global state or the `.opensearch_security` index.
|
||||
- You can't restore snapshots that contain global state or the `.opendistro_security` index.
|
||||
|
||||
If a snapshot contains global state, you must exclude it when performing the restore. If your snapshot also contains the `.opensearch_security` index, either exclude it or list all the other indices you want to include:
|
||||
If a snapshot contains global state, you must exclude it when performing the restore. If your snapshot also contains the `.opendistro_security` index, either exclude it or list all the other indices you want to include:
|
||||
|
||||
```json
|
||||
POST _snapshot/my-repository/3/_restore
|
||||
{
|
||||
"indices": "-.opensearch_security",
|
||||
"indices": "-.opendistro_security",
|
||||
"include_global_state": false
|
||||
}
|
||||
```
|
||||
|
||||
The `.opensearch_security` index contains sensitive data, so we recommend excluding it when you take a snapshot. If you do need to restore the index from a snapshot, you must include an admin certificate in the request:
|
||||
The `.opendistro_security` index contains sensitive data, so we recommend excluding it when you take a snapshot. If you do need to restore the index from a snapshot, you must include an admin certificate in the request:
|
||||
|
||||
```bash
|
||||
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XPOST 'https://localhost:9200/_snapshot/my-repository/3/_restore?pretty'
|
||||
|
||||
@@ -16,10 +16,10 @@ Asynchronous search in OpenSearch lets you send search requests that run in the
|
||||
|
||||
## REST API
|
||||
|
||||
To perform an asynchronous search, send requests to `_opensearch/_asynchronous_search`, with your query in the request body:
|
||||
To perform an asynchronous search, send requests to `_plugins/_asynchronous_search`, with your query in the request body:
|
||||
|
||||
```json
|
||||
POST _opensearch/_asynchronous_search
|
||||
POST _plugins/_asynchronous_search
|
||||
```
|
||||
|
||||
You can specify the following options.
|
||||
@@ -33,7 +33,7 @@ Options | Description | Default value | Required
|
||||
#### Sample request
|
||||
|
||||
```json
|
||||
POST _opensearch/_asynchronous_search/?pretty&size=10&wait_for_completion_timeout=1ms&keep_on_completion=true&request_cache=false
|
||||
POST _plugins/_asynchronous_search/?pretty&size=10&wait_for_completion_timeout=1ms&keep_on_completion=true&request_cache=false
|
||||
{
|
||||
"aggs": {
|
||||
"city": {
|
||||
@@ -116,7 +116,7 @@ Options | Description
|
||||
After you submit an asynchronous search request, you can request partial responses with the ID that you see in the asynchronous search response.
|
||||
|
||||
```json
|
||||
GET _opensearch/_asynchronous_search/<ID>?pretty
|
||||
GET _plugins/_asynchronous_search/<ID>?pretty
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
@@ -192,7 +192,7 @@ For asynchronous searches with `keep_on_completion` as `true` and a sufficiently
|
||||
You can use the DELETE API operation to delete any ongoing asynchronous search by its ID. If the search is still running, it’s canceled. If the search is complete, the saved search results are deleted.
|
||||
|
||||
```json
|
||||
DELETE _opensearch/_asynchronous_search/<ID>?pretty
|
||||
DELETE _plugins/_asynchronous_search/<ID>?pretty
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
@@ -208,7 +208,7 @@ DELETE _opensearch/_asynchronous_search/<ID>?pretty
|
||||
You can use the stats API operation to monitor asynchronous searches that are running, completed, and/or persisted.
|
||||
|
||||
```json
|
||||
GET _opensearch/_asynchronous_search/stats
|
||||
GET _plugins/_asynchronous_search/stats
|
||||
```
|
||||
|
||||
#### Sample response
|
||||
|
||||
@@ -21,7 +21,7 @@ PUT _cluster/settings
|
||||
}
|
||||
```
|
||||
|
||||
Similarly, you can also update the settings by sending the request to the plugin setting endpoing `_plugins/_query/setting`:
|
||||
Similarly, you can also update the settings by sending the request to the plugin setting endpoint `_plugins/_query/setting`:
|
||||
```json
|
||||
PUT _plugins/_query/settings
|
||||
{
|
||||
@@ -37,4 +37,4 @@ Setting | Default | Description
|
||||
`plugins.sql.slowlog` | 2 seconds | Configure the time limit (in seconds) for slow queries. The plugin logs slow queries as `Slow query: elapsed=xxx (ms)` in `opensearch.log`.
|
||||
`plugins.sql.cursor.keep_alive` | 1 minute | This value configures how long the cursor context is kept open. Cursor contexts are resource heavy, so we recommend a low value.
|
||||
`plugins.query.memory_limit` | 85% | This setting configures the heap memory usage limit for the circuit breaker of the query engine.
|
||||
`plugins.query.size_limit` | 200 | The setting sets the default size of index that the query engine fetches from OpenSearch.
|
||||
`plugins.query.size_limit` | 200 | The setting sets the default size of index that the query engine fetches from OpenSearch.
|
||||
|
||||
@@ -31,7 +31,7 @@ You can create users using OpenSearch Dashboards, `internal_users.yml`, or the R
|
||||
### OpenSearch Dashboards
|
||||
|
||||
1. Choose **Security**, **Internal Users**, and **Create internal user**.
|
||||
1. Provide a username and password. The security plugin automatically hashes the password and stores it in the `.opensearch_security` index.
|
||||
1. Provide a username and password. The security plugin automatically hashes the password and stores it in the `.opendistro_security` index.
|
||||
1. If desired, specify user attributes.
|
||||
|
||||
Attributes are optional user properties that you can use for variable substitution in index permissions or document-level security.
|
||||
|
||||
@@ -38,7 +38,7 @@ If you disable the security plugin in `opensearch.yml` (or delete the plugin ent
|
||||
|
||||
```
|
||||
FROM opensearchproject/opensearch-dashboards:{{site.opensearch_version}}
|
||||
RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove opensearchSecurityOpenSearch Dashboards
|
||||
RUN /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin remove security-dashboards
|
||||
COPY --chown=opensearch-dashboards:opensearch-dashboards opensearch_dashboards.yml /usr/share/opensearch-dashboards/config/
|
||||
```
|
||||
|
||||
|
||||
@@ -13,12 +13,13 @@ redirect_from:
|
||||
|
||||
The plugin includes demo certificates so that you can get up and running quickly, but before using OpenSearch in a production environment, you must configure it manually:
|
||||
|
||||
1. [Replace the demo certificates]({{site.url}}{{site.baseurl}}/opensearch/install/docker-security)
|
||||
1. [Reconfigure opensearch.yml to use your certificates]({{site.url}}{{site.baseurl}}/security-plugin/configuration/tls)
|
||||
1. [Reconfigure config.yml to use your authentication backend]({{site.url}}{{site.baseurl}}/security-plugin/configuration/configuration/) (if you don't plan to use the internal user database)
|
||||
1. [Modify the configuration YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml)
|
||||
1. [Apply changes using securityadmin.sh]({{site.url}}{{site.baseurl}}/security-plugin/configuration/security-admin)
|
||||
1. [Replace the demo certificates]({{site.url}}{{site.baseurl}}/opensearch/install/docker-security).
|
||||
1. [Reconfigure opensearch.yml to use your certificates]({{site.url}}{{site.baseurl}}/security-plugin/configuration/tls).
|
||||
1. [Reconfigure config.yml to use your authentication backend]({{site.url}}{{site.baseurl}}/security-plugin/configuration/configuration/) (if you don't plan to use the internal user database).
|
||||
1. [Modify the configuration YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml).
|
||||
1. If you plan to use the internal user database, [set a password policy in opensearch.yml]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml/#opensearchyml).
|
||||
1. [Apply changes using securityadmin.sh]({{site.url}}{{site.baseurl}}/security-plugin/configuration/security-admin).
|
||||
1. Start OpenSearch.
|
||||
1. [Add users, roles, role mappings, and tenants]({{site.url}}{{site.baseurl}}/security-plugin/access-control/index/)
|
||||
1. [Add users, roles, role mappings, and tenants]({{site.url}}{{site.baseurl}}/security-plugin/access-control/index/).
|
||||
|
||||
If you don't want to use the plugin, see [Disable security]({{site.url}}{{site.baseurl}}/security-plugin/configuration/disable).
|
||||
|
||||
@@ -8,11 +8,11 @@ redirect_from: /docs/security/configuration/security-admin/
|
||||
|
||||
# Apply configuration changes using securityadmin.sh
|
||||
|
||||
The security plugin stores its configuration---including users, roles, and permissions---in an index on the OpenSearch cluster (`.opensearch_security`). Storing these settings in an index lets you change settings without restarting the cluster and eliminates the need to edit configuration files on every single node.
|
||||
The security plugin stores its configuration---including users, roles, and permissions---in an index on the OpenSearch cluster (`.opendistro_security`). Storing these settings in an index lets you change settings without restarting the cluster and eliminates the need to edit configuration files on every single node.
|
||||
|
||||
After changing any of the configuration files in `plugins/opensearch-security/securityconfig`, however, you must run `plugins/opensearch-security/tools/securityadmin.sh` to load these new settings into the index. You must also run this script at least once to initialize the `.opensearch_security` index and configure your authentication and authorization methods.
|
||||
After changing any of the configuration files in `plugins/opensearch-security/securityconfig`, however, you must run `plugins/opensearch-security/tools/securityadmin.sh` to load these new settings into the index. You must also run this script at least once to initialize the `.opendistro_security` index and configure your authentication and authorization methods.
|
||||
|
||||
After the `.opensearch_security` index is initialized, you can use OpenSearch Dashboards to manage your users, roles, and permissions.
|
||||
After the `.opendistro_security` index is initialized, you can use OpenSearch Dashboards to manage your users, roles, and permissions.
|
||||
|
||||
|
||||
## Configure the admin certificate
|
||||
@@ -228,7 +228,7 @@ Name | Description
|
||||
`-esa` | Enable shard allocation and exit. This option is useful if you disabled shard allocation while performing a full cluster restart and need to recreate the security plugin index.
|
||||
`-w` | Displays information about the used admin certificate.
|
||||
`-rl` | By default, the security plugin caches authenticated users, along with their roles and permissions, for one hour. This option reloads the current security plugin configuration stored in your cluster, invalidating any cached users, roles, and permissions.
|
||||
`-i` | The security plugin index name. Default is `.opensearch_security`.
|
||||
`-i` | The security plugin index name. Default is `.opendistro_security`.
|
||||
`-er` | Set explicit number of replicas or auto-expand expression for the `opensearch_security` index.
|
||||
`-era` | Enable replica auto-expand.
|
||||
`-dra` | Disable replica auto-expand.
|
||||
|
||||
@@ -8,9 +8,9 @@ redirect_from: /docs/security/configuration/system-indices/
|
||||
|
||||
# System indices
|
||||
|
||||
By default, OpenSearch has a protected system index, `.opensearch_security`, which you create using [securityadmin.sh]({{site.url}}{{site.baseurl}}/security-plugin/configuration/security-admin/). Even if your user account has read permissions for all indices, you can't directly access the data in this system index.
|
||||
By default, OpenSearch has a protected system index, `.opendistro_security`, which you create using [securityadmin.sh]({{site.url}}{{site.baseurl}}/security-plugin/configuration/security-admin/). Even if your user account has read permissions for all indices, you can't directly access the data in this system index.
|
||||
|
||||
You can add additional system indices in in `opensearch.yml`. In addition to automatically creating `.opensearch_security`, the demo configuration adds several indices for the various OpenSearch plugins that integrate with the security plugin:
|
||||
You can add additional system indices in in `opensearch.yml`. In addition to automatically creating `.opendistro_security`, the demo configuration adds several indices for the various OpenSearch plugins that integrate with the security plugin:
|
||||
|
||||
```yml
|
||||
plugins.security.system_indices.enabled: true
|
||||
@@ -20,7 +20,7 @@ plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opend
|
||||
To access these indices, you must authenticate with an [admin certificate]({{site.url}}{{site.baseurl}}/security-plugin/configuration/tls#configure-admin-certificates):
|
||||
|
||||
```bash
|
||||
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opensearch_security/_search'
|
||||
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opendistro_security/_search'
|
||||
```
|
||||
|
||||
The alternative is to remove indices from the `plugins.security.system_indices.indices` list on each node and restart OpenSearch.
|
||||
|
||||
@@ -8,7 +8,7 @@ redirect_from: /docs/security/configuration/yaml/
|
||||
|
||||
# YAML files
|
||||
|
||||
Before running `securityadmin.sh` to load the settings into the `.opensearch_security` index, configure the YAML files in `plugins/opensearch-security/securityconfig`. You might want to back up these files so that you can reuse them on other clusters.
|
||||
Before running `securityadmin.sh` to load the settings into the `.opendistro_security` index, configure the YAML files in `plugins/opensearch-security/securityconfig`. You might want to back up these files so that you can reuse them on other clusters.
|
||||
|
||||
The best use of these YAML files is to configure [reserved and hidden resources]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#reserved-and-hidden-resources), such as the `admin` and `kibanaserver` users. You might find it easier to create other users, roles, mappings, action groups, and tenants using OpenSearch Dashboards or the REST API.
|
||||
|
||||
@@ -89,6 +89,42 @@ snapshotrestore:
|
||||
description: "Demo snapshotrestore user"
|
||||
```
|
||||
|
||||
## opensearch.yml
|
||||
|
||||
In addition to many OpenSearch settings, this file contains paths to TLS certificates and their attributes, such as distinguished names and trusted certificate authorities.
|
||||
|
||||
```yml
|
||||
plugins.security.ssl.transport.pemcert_filepath: esnode.pem
|
||||
plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem
|
||||
plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
|
||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||
plugins.security.ssl.http.enabled: true
|
||||
plugins.security.ssl.http.pemcert_filepath: esnode.pem
|
||||
plugins.security.ssl.http.pemkey_filepath: esnode-key.pem
|
||||
plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem
|
||||
plugins.security.allow_unsafe_democertificates: true
|
||||
plugins.security.allow_default_init_securityindex: true
|
||||
plugins.security.authcz.admin_dn:
|
||||
- CN=kirk,OU=client,O=client,L=test, C=de
|
||||
|
||||
plugins.security.audit.type: internal_opensearch
|
||||
plugins.security.enable_snapshot_restore_privilege: true
|
||||
plugins.security.check_snapshot_restore_write_privileges: true
|
||||
plugins.security.restapi.roles_enabled: ["all_access", "security_rest_api_access"]
|
||||
plugins.security.system_indices.enabled: true
|
||||
plugins.security.system_indices.indices: [".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opendistro-notifications-*", ".opendistro-notebooks", ".opendistro-asynchronous-search-response*"]
|
||||
node.max_local_storage_nodes: 3
|
||||
```
|
||||
|
||||
If you want to run your users' passwords against some validation, specify a regular expression (regex) in this file. You can also include an error message that loads when passwords don't pass validation. The following example demonstrates how to include a regex so OpenSearch requires new passwords to be a minimum of eight characters with at least one uppercase, one lowercase, one digit, and one special character.
|
||||
|
||||
Note that OpenSearch validates only users and passwords created through OpenSearch Dashboards or the REST API.
|
||||
|
||||
```yml
|
||||
plugins.restapi.password_validation_regex: '(?=.*[A-Z])(?=.*[^a-zA-Z\d])(?=.*[0-9])(?=.*[a-z]).{8,}'
|
||||
plugins.restapi.password_validation_error_message: "Password must be minimum 8 characters long and must contain at least one uppercase letter, one lowercase letter, one digit, and one special character."
|
||||
```
|
||||
|
||||
|
||||
## roles.yml
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
layout: default
|
||||
title: Upgrade from Kibana OSS to OpenSearch Dashboards
|
||||
nav_order: 50
|
||||
redirect_from:
|
||||
- /migrate/dashboards/
|
||||
---
|
||||
|
||||
# Upgrade from Kibana OSS to OpenSearch Dashboards
|
||||
|
||||
Kibana OSS stores its visualizations and dashboards in one or more indices (`.kibana*`) on the Elasticsearch OSS cluster. As such, the most important step is to leave those indices intact as you upgrade from Elasticsearch OSS to OpenSearch.
|
||||
|
||||
Consider exporting all Kibana objects prior to starting the upgrade. In Kibana, choose **Stack Management**, **Saved Objects**, **Export objects**.
|
||||
{: .tip }
|
||||
|
||||
1. After you upgrade your Elasticsearch OSS cluster to OpenSearch, stop Kibana.
|
||||
|
||||
1. For safety, make a backup copy of `<kibana-dir>/config/kibana.yml`.
|
||||
|
||||
1. Extract the OpenSearch Dashboards tarball to a new directory.
|
||||
|
||||
1. Port your settings from `<kibana-dir>/config/kibana.yml` to `<dashboards-dir>/config/opensearch_dashboards.yml`.
|
||||
|
||||
In general, settings with `elasticsearch` in their names map to `opensearch` (e.g. `elasticsearch.shardTimeout` and `opensearch.shardTimeout`) and settings with `kibana` in their names map to `opensearchDashboards` (e.g. `kibana.defaultAppId` and `opensearchDashboards.defaultAppId`). Most other settings use the same names.
|
||||
|
||||
For a full list of OpenSearch Dashboards settings, see [here](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/config/opensearch_dashboards.yml){:target='\_blank'}.
|
||||
|
||||
1. If your OpenSearch cluster uses the security plugin, preserve and modify the default settings in `opensearch_dashboards.yml`, particularly `opensearch.username` and `opensearch.password`.
|
||||
|
||||
If you disabled the security plugin on your OpenSearch cluster, remove or comment out all `opensearch_security` settings. Then run `rm -rf plugins/security-dashboards/` to remove the security plugin.
|
||||
|
||||
1. Start OpenSearch Dashboards:
|
||||
|
||||
```
|
||||
./bin/opensearch-dashboards
|
||||
```
|
||||
|
||||
1. Log in, and verify that your saved searches, visualizations, and dashboards are present.
|
||||
@@ -1,12 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Docker migration
|
||||
title: Upgrade Docker clusters to OpenSearch
|
||||
nav_order: 25
|
||||
redirect_from:
|
||||
- /migrate/docker-migrate/
|
||||
---
|
||||
|
||||
# Docker migration
|
||||
# Upgrade Docker clusters to OpenSearch
|
||||
|
||||
If you use a container orchestration system like Kubernetes (or manage your containers manually) and want to avoid downtime, think of the process not as an upgrade of each node, but as a decommissioning and replacement of each node. One by one, add OpenSearch nodes to the cluster and remove Elasticsearch OSS nodes, allowing time for all indices to return to a green status prior to proceeding.
|
||||
If you use a container orchestration system like Kubernetes (or manage your containers manually) and want to avoid downtime, think of the process not as an upgrade of each node, but as a decommissioning and replacement of each node. One by one, add OpenSearch nodes to the cluster and remove Elasticsearch OSS nodes, pointing to existing data volumes as necessary and allowing time for all indices to return to a green status prior to proceeding.
|
||||
|
||||
If you use Docker Compose, we highly recommend that you perform what amounts to a [cluster restart upgrade]({{site.url}}{{site.baseurl}}/migrate/upgrade-migrate/). Update your cluster configuration with new images, new settings, and new environment variables, and test it. Then stop and start the cluster. This process requires downtime, but takes very few steps and lets you continue to treat the cluster as a single entity that you can reliably deploy and redeploy.
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
layout: default
|
||||
title: About the process
|
||||
nav_order: 1
|
||||
redirect_from:
|
||||
- /migrate/
|
||||
- /upgrade-to/
|
||||
---
|
||||
|
||||
# About the process
|
||||
|
||||
The process of upgrading from Elasticsearch OSS (including Open Distro for Elasticsearch) to OpenSearch varies depending on your current version of Elasticsearch OSS, install type, tolerance for downtime, and cost-sensitivity. Rather than concrete steps to cover every situation, we have general guidance for the process.
|
||||
|
||||
Three approaches exist:
|
||||
|
||||
- Use a snapshot to [migrate your Elasticsearch OSS data]({{site.url}}{{site.baseurl}}/upgrade-to/snapshot-migrate/) to a new OpenSearch cluster.
|
||||
- Perform a [rolling upgrade or cluster restart upgrade]({{site.url}}{{site.baseurl}}/upgrade-to/upgrade-to/) on your existing nodes.
|
||||
- Replace existing Elasticsearch OSS nodes with new OpenSearch nodes. Node replacement is most popular when upgrading [Docker clusters]({{site.url}}{{site.baseurl}}/upgrade-to/docker-upgrade-to/).
|
||||
|
||||
Regardless of your approach, to safeguard against data loss, we recommend that you take a [snapshot]({{site.url}}{{site.baseurl}}/opensearch/snapshot-restore/) of all indices prior to any migration.
|
||||
{: .tip }
|
||||
@@ -1,10 +1,12 @@
|
||||
---
|
||||
layout: default
|
||||
title: Snapshot migration
|
||||
title: Use snapshots to migrate data
|
||||
nav_order: 5
|
||||
redirect_from:
|
||||
- /migrate/snapshot-migrate/
|
||||
---
|
||||
|
||||
# Snapshot migration
|
||||
# Use snapshots to migrate data
|
||||
|
||||
One popular approach is to take a [snapshot]({{site.url}}{{site.baseurl}}/opensearch/snapshot-restore/) of your Elasticsearch OSS 6.x or 7.x indices, [create an OpenSearch cluster]({{site.url}}{{site.baseurl}}/opensearch/install/), restore the snapshot on the new cluster, and point your clients to the new host.
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
layout: default
|
||||
title: Upgrade from Elasticsearch OSS to OpenSearch
|
||||
nav_order: 15
|
||||
redirect_from:
|
||||
- /migrate/upgrade-migrate/
|
||||
---
|
||||
|
||||
# Upgrade from Elasticsearch OSS to OpenSearch (Linux)
|
||||
# Upgrade from Elasticsearch OSS to OpenSearch
|
||||
|
||||
If you want to migrate an existing Elasticsearch OSS cluster to OpenSearch and find the [snapshot approach]({{site.url}}{{site.baseurl}}/migrate/snapshot-migrate/) unappealing, you can upgrade the cluster instead. The first step is to upgrade your Elasticsearch OSS cluster to version 6.x or 7.x.
|
||||
If you want to upgrade from an existing Elasticsearch OSS cluster to OpenSearch and find the [snapshot approach]({{site.url}}{{site.baseurl}}/migrate/snapshot-migrate/) unappealing, you can upgrade your existing nodes from Elasticsearch OSS to OpenSearch.
|
||||
|
||||
Elasticsearch OSS supports two types of upgrades: rolling and cluster restart.
|
||||
If your existing cluster runs an older version of Elasticsearch OSS, the first step is to upgrade to version 6.x or 7.x. Elasticsearch OSS supports two types of upgrades: rolling and cluster restart.
|
||||
|
||||
- Rolling upgrades let you shut down one node at a time for minimal disruption of service.
|
||||
|
||||
@@ -121,7 +123,7 @@ Elasticsearch OSS version | Rolling upgrade path | Cluster restart upgrade path
|
||||
sudo systemctl stop elasticsearch.service
|
||||
```
|
||||
|
||||
For tarball installations, find the process ID and kill it.
|
||||
For tarball installations, find the process ID (`ps aux`) and kill it (`kill <pid>`).
|
||||
|
||||
1. Upgrade the node (rolling) or all nodes (cluster restart).
|
||||
|
||||
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 141 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 357 KiB |
|
After Width: | Height: | Size: 367 KiB |
|
After Width: | Height: | Size: 313 KiB |
@@ -37,7 +37,7 @@ Component | Purpose
|
||||
[Anomaly Detection]({{site.url}}{{site.baseurl}}/monitoring-plugins/ad/) | Identify atypical data and receive automatic notifications
|
||||
[Asynchronous Search]({{site.url}}{{site.baseurl}}/search-plugins/async/) | Run search requests in the background
|
||||
|
||||
You can install OpenSearch plugins [individually]({{site.url}}{{site.baseurl}}/opensearch/install/plugins/) or use the [all-in-one packages]({{site.url}}{{site.baseurl}}/opensearch/install/). Most of these OpenSearch plugins have corresponding OpenSearch Dashboards plugins that provide a convenient, unified user interface.
|
||||
Most of OpenSearch plugins have a corresponding OpenSearch Dashboards plugin that provide a convenient, unified user interface.
|
||||
|
||||
For specifics around the project, see the [FAQ](https://opensearch.org/faq/).
|
||||
|
||||
@@ -65,7 +65,10 @@ Docker
|
||||
To learn more, see [Install and configure OpenSearch]({{site.url}}{{site.baseurl}}/opensearch/install/) and [Install and configure OpenSearch Dashboards]({{site.url}}{{site.baseurl}}/dashboards/install/).
|
||||
|
||||
|
||||
---
|
||||
## The secure path forward
|
||||
|
||||
OpenSearch includes a demo configuration so that you can get up and running quickly, but before using OpenSearch in a production environment, you must [configure the security plugin manually]({{site.url}}{{site.baseurl}}/security-plugin/configuration/index/): your own certificates, your own authentication method, your own users, and your own passwords.
|
||||
|
||||
|
||||
## Looking for the Javadoc?
|
||||
|
||||
|
||||