# DEPRECATED - OpenSearch

{% hint style="warning" %}
This guide is no longer relevant as OpenSearch is now directly installable with OpenG2P Modules. This guide will soon be removed.
{% endhint %}

Logs captured by [Fluentd](/operations/deployment/scaling/base-infrastructure/openg2p-cluster/fluentd-and-opensearch.md) from different components are pushed to [OpenSearch](https://opensearch.org/) for search, display, and reports.

## Prerequisites

* The following utilities/tools must be present on the user's machine.
  * `kubectl`, `istioctl`, `helm`, `jq`, `curl`, `wget`, `git`, `bash`, `envsubst`.
* [Keycloak](broken://pages/dQgqgbcQa7z1dRigG2lV) for Authentication and Sign-in to UI

## Installation

Clone the <https://github.com/openg2p/openg2p-deployment> repo and navigate to [kubernetes/logging](https://github.com/OpenG2P/openg2p-deployment/tree/main/kubernetes/logging) directory.

### Install OpenSearch (and related components)

* Run this to install OpenSearch and related components.

  ```bash
  SANDBOX_HOSTNAME="openg2p.sandbox.net" \
      ./install.sh
  ```
* After successful installation, OpenSearch dashboards can be accessed using the hostname given above.

### Add *Index State Policy* on OpenSearch

* Run this to add [ISM](https://opensearch.org/docs/latest/im-plugin/ism/index/) Policy (This is responsible for automatically deleting `logstash` indices after 3 days. Configure the minimum age to delete indices, in the same script below.)

  ```bash
  ./opensearch-ism-script.sh
  ```

### Dashboards

*TBD*

#### Access control on dashboards:

*TBD*

### TraceId

*TBD*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/operations/deployment/scaling/base-infrastructure/openg2p-cluster/fluentd-and-opensearch/opensearch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
