Introduction

OpenSearch is a powerful, open-source search and analytics suite that enables organizations to capture, store, and analyze vast amounts of data. One of its most valuable features is OpenSearch Dashboards, a visualization tool that allows you to create insightful visual representations of your data and build comprehensive dashboards.

In this tutorial, we'll walk through the process of creating your first OpenSearch Dashboard from scratch. You'll learn how to navigate the interface, create visualizations, and combine them into an informative dashboard that provides meaningful insights into your data.

Prerequisites

Before getting started, ensure you have:

  • An OpenSearch cluster up and running
  • OpenSearch Dashboards installed and connected to your cluster
  • Sample data loaded into your OpenSearch cluster (we'll use the sample flight data that comes with OpenSearch)

Step 1: Accessing OpenSearch Dashboards

  1. Open your web browser and navigate to your OpenSearch Dashboards URL (typically http://localhost:5601 for local installations)
  2. Log in with your credentials if prompted
  3. You should now see the OpenSearch Dashboards home page

Step 2: Loading Sample Data

If you don't already have data in your OpenSearch cluster, we can use the built-in sample data sets:

OpenSearch Sample Data Page

  1. From the OpenSearch Dashboards home page, click on the "Add sample data" link
  2. Look for the "Sample flight data" card and click "Add data"
  3. Wait for the confirmation message that indicates the data has been successfully loaded
  4. You'll notice that this adds not only data but also creates sample visualizations and a dashboard that we can use for reference

Sample Flight Data Added

Step 3: Creating Your First Visualization

Let's create our first visualization:

  1. From the left navigation menu, click on "Visualize"
  2. Click the "Create visualization" button
  3. You'll see a variety of visualization types. For our first visualization, select "Vertical bar"
  4. In the source selection screen, choose "opensearch_dashboards_sample_data_flights" index pattern

Now, let's configure our visualization:

  1. In the metrics section (Y-axis), you should see "Count" as the default metric
  2. Click on the "Buckets" section, then select "X-axis"
  3. For "Aggregation," select "Terms"
  4. For "Field," select "DestCountry"
  5. In the "Size" field, enter 10 (to show the top 10 destination countries)
  6. Click the "Update" button at the bottom of the panel

You should now see a bar chart showing the count of flights to the top 10 destination countries.

Vertical Bar Chart Configuration

Let's enhance our visualization:

  1. Click on "Add metrics" under the Y-axis section
  2. Select "Average" as the aggregation
  3. Select "AvgTicketPrice" as the field
  4. Click "Update"

Now our visualization shows both the count of flights and the average ticket price for each destination country.

Enhanced Bar Chart with Multiple Metrics

Let's save this visualization:

  1. Click the "Save" button in the top right corner
  2. Name it "Top Destination Countries"
  3. Click "Save" to confirm

Step 4: Creating a Second Visualization

Let's create another visualization to include in our dashboard:

  1. Go back to the Visualize page by clicking "Visualize" in the left menu
  2. Click "Create visualization" again
  3. This time, select "Pie" as the visualization type
  4. Choose the "opensearch_dashboards_sample_data_flights" index pattern again

Configure the pie chart:

  1. Keep "Count" as the metric
  2. Click on "Buckets" and select "Split slices"
  3. For "Aggregation," select "Terms"
  4. For "Field," choose "Carrier"
  5. Keep the size at 5 to show the top 5 carriers
  6. Click "Update"

Pie Chart Configuration

You should now see a pie chart showing the distribution of flights by carrier.

Completed Pie Chart

Let's save this visualization:

  1. Click the "Save" button
  2. Name it "Flights by Carrier"
  3. Click "Save"

Step 5: Creating a Time-Based Visualization

Let's add a time-based visualization:

  1. Go back to the Visualize page
  2. Click "Create visualization"
  3. Select "Line" as the visualization type
  4. Choose the "opensearch_dashboards_sample_data_flights" index pattern

Configure the line chart:

  1. Keep "Count" as the Y-axis metric
  2. Click on "Buckets" and select "X-axis"
  3. For "Aggregation," select "Date Histogram"
  4. For "Field," choose "timestamp"
  5. Keep the default interval at "Auto"
  6. Click "Add sub-buckets" and select "Split series"
  7. For "Sub aggregation," select "Terms"
  8. For "Field," choose "Carrier"
  9. Set "Size" to 3 to show the top 3 carriers
  10. Click "Update"

You should now see a line chart showing flight counts over time, split by the top 3 carriers.

Let's save this visualization:

  1. Click the "Save" button
  2. Name it "Flight Trends by Carrier"
  3. Click "Save"

Step 6: Creating the Dashboard

Now that we have several visualizations, let's combine them into a dashboard:

  1. From the left navigation menu, click on "Dashboard"
  2. Click "Create dashboard"
  3. Click "Add" in the top right corner
  4. You should see a list of your saved visualizations
  5. Click on "Top Destination Countries" to add it to the dashboard
  6. Click "Add" again and select "Flights by Carrier"
  7. Click "Add" once more and select "Flight Trends by Carrier"

Now, let's arrange our visualizations:

Dashboard with Added Visualizations

  1. Drag and resize each visualization panel to arrange them logically
  2. You can drag from the top of each panel to move it
  3. Drag from the bottom-right corner to resize it
  4. Arrange them so they tell a coherent story about the flight data

Arranging Dashboard Panels

Let's save our dashboard:

  1. Click the "Save" button in the top right corner
  2. Name it "Flight Analytics Dashboard"
  3. Optionally, add a description like "Overview of flight statistics including destinations, carriers, and trends"
  4. Click "Save" to confirm

Saving the Dashboard

Step 7: Enhancing Your Dashboard

Let's add some finishing touches to make our dashboard more interactive and informative:

Adding a Filter Control

  1. While in your dashboard, click "Edit" in the top right corner
  2. Click "Add" and select "Controls" from the menu
  3. Choose "Option List"
  4. Configure it as follows:
    • Label: "Carrier Filter"
    • Index pattern: "opensearch_dashboards_sample_data_flights"
    • Field: "Carrier"
  5. Click "Save" and position it at the top of your dashboard

Adding a Time Range Selector

  1. While still in edit mode, click on the time range in the top right corner
  2. Select a default time range that includes all of your sample data
  3. You can also enable auto-refresh if you want the dashboard to update automatically

Adding a Markdown Panel

  1. Click "Add" and select "Create new"
  2. Select "Markdown" as the visualization type
  3. In the editor, add a descriptive text like:
## Flight Analytics Overview

   This dashboard provides insights into flight patterns, including:

   - Top destination countries
   - Distribution of flights by carrier
   - Trends over time

   Use the filters above to explore specific segments of data.
  1. Click "Save" and name it "Dashboard Description"
  2. Add it to your dashboard and position it at the top

Save Your Enhanced Dashboard

  1. Click "Save" to update your dashboard with these enhancements
  2. Click "Exit editing" to view the final result

Enhanced Dashboard with Controls

Step 8: Using Your Dashboard

Now that your dashboard is complete, let's explore how to use it effectively:

Using Dashboard Time Controls

  1. Use the time range selector to focus on specific time periods
  2. Click on elements in one visualization to filter all visualizations (this is called cross-filtering)
  3. Use the Carrier filter to focus on specific airlines
  4. Hover over elements to see detailed tooltips

Cross-Filtering in Action

  1. Click the "Share" button to get a link to your dashboard that you can share with others

Sharing Dashboard Options

Step 9: Saving and Exporting Dashboard

OpenSearch Dashboards allows you to save your dashboard configuration for future use and sharing:

  1. To export your dashboard, click on "Management" in the left navigation
  2. Select "Saved Objects"
  3. Find your dashboard in the list and click the "Export" button
  4. This will download a JSON file containing your dashboard configuration
  5. You can import this file on another OpenSearch installation to recreate your dashboard

Advanced Tips

Here are some advanced tips to take your OpenSearch dashboards to the next level:

  1. Use Dashboard Only Mode: For sharing with non-technical users, you can use the "Dashboard Only Mode" which provides a cleaner interface.

  2. Set Refresh Intervals: For real-time data, set automatic refresh intervals to keep your dashboard up to date.

  3. Create Multiple Dashboards: Create different dashboards for different purposes or user groups, each focusing on specific aspects of your data.

  4. Use Drilldowns: Configure drilldowns to allow users to click on elements and navigate to more detailed dashboards.

  5. Add Annotations: For time-based visualizations, you can add annotations to mark important events or milestones.

Troubleshooting Common Issues

Here are solutions to some common issues you might encounter:

  1. Visualizations Not Showing Data: Check that your time range encompasses the data you're trying to visualize.

  2. Performance Issues: If your dashboard is slow, try reducing the time range or the number of buckets in your aggregations.

  3. Filtering Not Working: Ensure that the fields you're filtering on are available in all visualizations.

  4. Dashboard Not Saving: Check that you have the necessary permissions to save objects in OpenSearch Dashboards.

Conclusion

Complete Dashboard Example

Congratulations! You've successfully created your first OpenSearch Dashboard. You've learned how to:

  • Create various types of visualizations
  • Combine visualizations into a cohesive dashboard
  • Add interactive controls and filters
  • Enhance your dashboard with descriptions and context
  • Use your dashboard to explore and analyze data