4. Search Logs
OpenSearch provides us the ability to analyze out logs. Let’s begin by navigating to the OpenSearch Dashboard
Step 1 - Open the OpenSearch Dashboard
- Go to the OpenSearch Console
- Click on the fluentd-domain OpenSearch domain you created earlier

- Click on the OpenSearch Dashboard URL. This should open the URL in a web browser window

- You will be prompted to log in. For the user name enter
OSMasterUser
for the password enter AwS#OpenSearch1
- If an additional popup window is present after login asking about data upload click on Explore on my own
- If an additional popup window is present asking you to select your tenant select Global and click on Confirm
You should now see a window that looks like this

Step 2 - Create an Index Pattern
In order to search our logs via. the OpenSearch dashboard you need to create an index pattern. Follow the steps below to create an index pattern for the Fluentd logs
- In the OpenSearch Dashboard, expand the side menu and click on Stack Management under management section

- On the stack management page click on Index Patterns on the left hand menu

- On the index patterns page click on Create index pattern

- Enter
fluentd*
under the index pattern name section

- Click on Next step
- Click on the time field drop down and select @timestamp

- Click on Create index pattern
You have now created an index pattern! You can use the index pattern to analyze our logs
Step 3 - Search the Logs
OpenSearch provides the ability to easily search log data. Let’s view and search our logs sent by Fluentd
- In the OpenSearch Dashboard expand the side menu and click on Discover under the OpenSearch Dashboards section

- Expand the time range that OpenSearch will view to the Last 7 days

You can now see the logs sent to OpenSearch from Fluentd

You can expand any of the logs to view all of the available fields

You can also search logs using the search bar at the top of the page

When you are ready proceed to the next step Clean Up if you want to delete the resources you used for this workshop