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
- 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.
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.
6. That's It β Youβre All Set! ππ
- Your logs should now appear in the dashboard:
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! π
Top comments (0)