1. Set Up OpenSearch Dashboard using Instaclustr
Refer to this video to create a cluster: Getting started with OpenSearch on Instaclustr

⚠️ Note: It may take a few minutes for your cluster to start running.

2. Set Up OpenSearch & Integrate Logging in Your Application

  • Once your cluster is running, go to the Connection Info section below your cluster details. There, you’ll find your OpenSearch username and password.
  • Scroll down to find the public host address and port — this is the host you'll use to set up logging in your app

Image description

  • Once you have all things, install below npm packages

npm install winston @opensearch-project/opensearch
yarn add winston @opensearch-project/opensearch

  • Paste the code from this gist into logger.js file in your project.
  • Run your application — you should see logs printing to the console.

3. Set Up Your Index in OpenSearch

  • Head over to your OpenSearch Dashboard.
  • Navigate to Dashboard Management → Index Patterns to create and manage your index.

Image description

4. Send Logs from Your Application to OpenSearch 🚀🚀

  • Once the index is set up, your application logs will start flowing into OpenSearch automatically!

5. View Logs in OpenSearch Dashboards

  • Go to the OpenSearch Dashboard Overview page.
  • Click on Discover.

Image description

6. That's It — You’re All Set! 🚀🚀

  • Your logs should now appear in the dashboard:

Image description

That’s all you need to get started with OpenSearch logging in your Node.js application.
You can now monitor, search, and visualize logs in real time — right from your OpenSearch dashboard.

If you run into any issues or have questions, feel free to reach out or drop a comment. Happy logging! 🚀