Observability Dashboard Overview in Elastic Stack

In this article we will learn about Observability Dashboard Overview in Elastic Stack. Monitoring your Nginx web server is essential to keep your website fast and reliable. In this guide, you’ll learn how to turn raw Nginx logs into an interactive dashboard using Elastic Stack. We’ll use Filebeat to collect logs, Elasticsearch to store them, and Kibana to visualize traffic, errors, and security threats. By the end, you’ll have a powerful observability dashboard to track performance in real time.

Prerequisites

  • AWS account with an Ubuntu 24.04 EC2 instance.
  • Instance with at least 2 CPU cores and 4 GB of RAM for optimal performance.
  • Java and Nginx installed.

Step #1:Set Up Ubuntu EC2 Instance

Update the Package List to ensure you have the latest versions.

sudo apt update
Observability Dashboard Overview in Elastic Stack 1

Elasticsearch requires Java, so we need to install OpenJDK 11.

sudo apt install -y openjdk-17-jdk
Observability Dashboard Overview in Elastic Stack 2

Install the Nginx web server.

sudo apt install -y nginx
Observability Dashboard Overview in Elastic Stack 3

Check the status of the Nginx to ensure it is running.

sudo systemctl status nginx
Observability Dashboard Overview in Elastic Stack 4

Step #2:Install Elasticsearch on Ubuntu 24.04 LTS

Import the Elasticsearch GPG key.

curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
Observability Dashboard Overview in Elastic Stack 5

Add the Elasticsearch repository.

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
Observability Dashboard Overview in Elastic Stack 6

Now lets update the package list again. The repository is added to the system’s package sources.

sudo apt update
Observability Dashboard Overview in Elastic Stack 7

Install Elasticsearch.

sudo apt install -y elasticsearch
Observability Dashboard Overview in Elastic Stack 8

Modify Elasticsearch configuration for remote access.

sudo nano /etc/elasticsearch/elasticsearch.yml
Observability Dashboard Overview in Elastic Stack 9

Find the network.host setting, uncomment it, and set it to 0.0.0.0 to bind to all available IP addresses and uncomment the discovery section to specify the initial nodes for cluster formation discovery.seed_hosts: []

How to Install Elastic Stack on Ubuntu 24.04 LTS 15

For a basic setup (not recommended for production), disable security features.

xpack.security.enabled: false
How to Install Elastic Stack on Ubuntu 24.04 LTS 16

Save and exit the editor.

Enable and start Elasticsearch.

sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
Observability Dashboard Overview in Elastic Stack 10

Check the status of the elasticsearch to ensure it is running.

sudo systemctl status elasticsearch
Observability Dashboard Overview in Elastic Stack 11

Send a GET request to check if Elasticsearch is running and responding. If successful, you should see a JSON response with cluster information.

curl -X GET "localhost:9200"
Observability Dashboard Overview in Elastic Stack 12

You can access it using browser with your Public IP address:9200 port which is a default port for Elasticksearch.

Observability Dashboard Overview in Elastic Stack 13

Step #3:Install Kibana on Ubuntu 24.04 LTS

Kibana provides visualization for Elasticsearch data. Install Kibana on the system.

sudo apt install -y kibana
Observability Dashboard Overview in Elastic Stack 14

Open the Kibana configuration file for editing.

sudo nano /etc/kibana/kibana.yml
Observability Dashboard Overview in Elastic Stack 15

Uncomment and adjust the following lines to bind Kibana to all IP addresses and connect it to Elasticsearch.

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
How to Install Elastic Stack on Ubuntu 24.04 LTS 27

Enable and start Kibana.

sudo systemctl enable kibana
sudo systemctl start kibana
Observability Dashboard Overview in Elastic Stack 16

Checks the status of Kibana.

sudo systemctl status kibana
Observability Dashboard Overview in Elastic Stack 17

Access the Kibana interface by navigating to http://<your-server-ip>:5601 in your web browser. This will open the Kibana dashboard where you can start exploring your data.

Observability Dashboard Overview in Elastic Stack 18

You can start by adding integrations or Explore on my own.

Observability Dashboard Overview in Elastic Stack 19

Step #4:Install Filebeat on Ubuntu 24.04 LTS

Filebeat collects and forwards log data to Elasticsearch or Logstash. Install Filebeat on the system.

sudo apt install -y filebeat
Observability Dashboard Overview in Elastic Stack 20

No need to edit the filebeat configuration as by default it is configured to send logs to Elasticsearch.

Enable the Nginx module in Filebeat.

sudo filebeat modules enable nginx
Observability Dashboard Overview in Elastic Stack 21

Configure the Nginx module for log collection.

sudo nano /etc/filebeat/modules.d/nginx.yml
Observability Dashboard Overview in Elastic Stack 22

Ensure the following configuration is enabled to send Nginx logs.

- module: nginx
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: ["/var/log/nginx/access.log*"]

  # Error logs
  error:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: ["/var/log/nginx/error.log*"]

  # Ingress-nginx controller logs. This is disabled by default. It could be used in Kubernetes environments to parse ingress-nginx logs
  ingress_controller:
    enabled: false

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    #var.paths:
Observability Dashboard Overview in Elastic Stack 23

Save and exit the file.

Test the configuration.

sudo filebeat test config
Observability Dashboard Overview in Elastic Stack 24

Apply Filebeat setup changes.

sudo filebeat setup
Observability Dashboard Overview in Elastic Stack 25

Start and enable the Filebeat service.

sudo systemctl enable filebeat
sudo systemctl start filebeat
Observability Dashboard Overview in Elastic Stack 26

Checks the status of filebeat.

sudo systemctl status filebeat
Observability Dashboard Overview in Elastic Stack 27

Ensure Elasticsearch is receiving data from Filebeat by checking the indices.

curl -XGET "localhost:9200/_cat/indices?v"

You should see output indicating the presence of indices created by Filebeat.

Observability Dashboard Overview in Elastic Stack 28

Step #5:Verify Nginx Logs in Kibana

Access the Nginx using following command.

curl http://localhost
Observability Dashboard Overview in Elastic Stack 29

Or Open your browser and navigate to http://<your-server-ip>. The default Nginx welcome page should appear.

Observability Dashboard Overview in Elastic Stack 30

Now go back to Kibana. Scroll down and click on the Logs option in Obeservability in the left-hand navigation menu. If the menu is collapsed, click the Expand icon at the bottom left to reveal the options.

Observability Dashboard Overview in Elastic Stack 31

Kibana displays Nginx logs data from the last 15 minutes, visualized as a histogram along with individual log messages below. (You may need to adjust the time range.)

Observability Dashboard Overview in Elastic Stack 32
Observability Dashboard Overview in Elastic Stack 33
Observability Dashboard Overview in Elastic Stack 34

To generate a 404 Not Found error and see it in Kibana, access the following page on browser.

http://<public-ip-address>/this-page-does-not-exist

This request will be logged in Nginx access log and should be visible in Kibana.

Observability Dashboard Overview in Elastic Stack 35
http://<public-ip-address>/page-not-found
Observability Dashboard Overview in Elastic Stack 36

Now refresh the kibana logs page.

Observability Dashboard Overview in Elastic Stack 37

You can even see the details of Nginx logs. You can see the details of our Cloud provider also some other details.

Observability Dashboard Overview in Elastic Stack 38
Observability Dashboard Overview in Elastic Stack 39

Step #6:Building the Observability Dashboard

Next we will create an Observability Dashboard. First in Kibana, go to Dashboard.

Observability Dashboard Overview in Elastic Stack 40

Click on Create dashboard.

Observability Dashboard Overview in Elastic Stack 41

Click Create visualization to add your first chart.

Observability Dashboard Overview in Elastic Stack 42

Add Area Chart (HTTP Status Over Time)

  • Choose Area as the visualization type and select filebeat-* as the data view.
  • Set Horizontal axis (X-axis) to @timestamp, Verticle axis (Y-axis) to Count, and add http.response.status_code in the Breakdown field.
  • Click Save and return.
Observability Dashboard Overview in Elastic Stack 43

As you can see our area visualization is added. Now go to Add panel as shown below.

Observability Dashboard Overview in Elastic Stack 44

Select Maps as a Visualization.

Observability Dashboard Overview in Elastic Stack 45

Click on Add layer.

Observability Dashboard Overview in Elastic Stack 46

Select Documents to add layer.

Observability Dashboard Overview in Elastic Stack 47

Use filebeat-* as data view and source.geo.location as the geospatial field. Click on Add and continue

Observability Dashboard Overview in Elastic Stack 48

In Tooltip fields add source.geo.country_name and http.response.status_code. Click on Keep changes.

Observability Dashboard Overview in Elastic Stack 49

Next click on Save and return.

Observability Dashboard Overview in Elastic Stack 50

You can see that our Maps visualization is added. Click on Create visualization.

Observability Dashboard Overview in Elastic Stack 51

Select Visualization Type: Pie, filebeat-* as a Data view.

Set Slice by to user_agent.name and Metric to Count. Then click on Save and return.

Observability Dashboard Overview in Elastic Stack 52

You can see our pie chart is added below. Again click on Create visualization to add another visualization in our dashboard.

Observability Dashboard Overview in Elastic Stack 53

Again, create a new Pie visualization with filebeat-* as Data view.

Set Slice by to url.path and Metric to Count. Then click on Save and return.

Observability Dashboard Overview in Elastic Stack 54

You can see it in below image. Once all visualizations are added, click Save to save the dashboard.

Observability Dashboard Overview in Elastic Stack 55

Enter the Title for a dashboard like Nginx Observability Dashboard. Click on Save.

Observability Dashboard Overview in Elastic Stack 56

You can now find it under Dashboards, ready to monitor your Nginx traffic, status codes, locations, and more in real time. Now go to Dashboards to verify our dashboard is saved.

Observability Dashboard Overview in Elastic Stack 57

As you can see our Nginx Observability Dashboard is present.

Observability Dashboard Overview in Elastic Stack 58
Observability Dashboard Overview in Elastic Stack 59

Conclusion:

In conclusion, you’ve successfully built a real-time Nginx observability dashboard using the Elastic Stack. You can now track access logs, errors, and unusual traffic patterns easily through Kibana’s visual interface. This setup helps improve website performance, identify issues faster, and strengthen your web server’s reliability. As a next step, you can explore alerts, dashboards, and custom visualizations to enhance observability even more.

Related Articles:

Monitor .NET App Logs Using Elastic Stack

Send Java Gradle App Logs to Elastic Stack

Send Java Maven App Logs to Elastic Stack

Reference:

Elastic Stack official page

Prasad Hole

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap