Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Testing the ELK in DevOps | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Monitoring and Observability

bookTesting the ELK in DevOps

Now that the Docker Compose file is fully configured and all services are defined, it is time to test the system. Testing ensures that each component — the Flask application, Filebeat, Logstash, Elasticsearch, and Kibana — is running correctly and communicating with each other as expected.

Building Containers

To start the containers in detached mode and ensure any changes in the Dockerfiles are applied, run:

This command rebuilds the images if there are any changes (--build) and starts all containers in the background (-d) so your terminal remains free. It ensures that the latest configuration and code are applied without blocking your terminal.

After starting the containers, it is important to verify that all services are running correctly. Run the following command in your terminal:

This command lists all containers along with their status, names, and ports. You should see that every container — the Flask application, Filebeat, Logstash, Elasticsearch, and Kibana — is in the UP state.

If any container is not in this state, check its logs to identify and fix the issue before proceeding.

Testing the ELK Logging Pipeline

Open your browser and go to localhost:5601. Kibana runs on this port. Once the interface loads, open the panel on the left and go to the Discover tab.

Click Create data view to specify which logs to display:

  • Enter a name, for example logs;

  • In the Index pattern field, enter flask-logs*. The asterisk means any index starting with flask-logs will be included;

  • Click Save data view.

Kibana will now display logs from the application. At this point, only the initial startup records appear.

Next, test the application by opening localhost:5050 in a new browser tab. Visiting pages creates log events in the container, which are processed by Filebeat and Logstash and displayed in Kibana. Go back to Kibana and click Refresh. Within 10–15 seconds, new logs appear, such as "User opened the home page" or "User clicked the button".

All containers are running, and the ELK pipeline is fully functional. Logs from the Flask app are collected, processed, and displayed in Kibana in real time. Your logging system is now ready to monitor and analyze application activity.

1. Which command correctly starts all containers defined in the Docker Compose file?

2. What port do you use to access Kibana in this setup?

question mark

Which command correctly starts all containers defined in the Docker Compose file?

Select the correct answer

question mark

What port do you use to access Kibana in this setup?

Select the correct answer

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 6

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

bookTesting the ELK in DevOps

Свайпніть щоб показати меню

Now that the Docker Compose file is fully configured and all services are defined, it is time to test the system. Testing ensures that each component — the Flask application, Filebeat, Logstash, Elasticsearch, and Kibana — is running correctly and communicating with each other as expected.

Building Containers

To start the containers in detached mode and ensure any changes in the Dockerfiles are applied, run:

This command rebuilds the images if there are any changes (--build) and starts all containers in the background (-d) so your terminal remains free. It ensures that the latest configuration and code are applied without blocking your terminal.

After starting the containers, it is important to verify that all services are running correctly. Run the following command in your terminal:

This command lists all containers along with their status, names, and ports. You should see that every container — the Flask application, Filebeat, Logstash, Elasticsearch, and Kibana — is in the UP state.

If any container is not in this state, check its logs to identify and fix the issue before proceeding.

Testing the ELK Logging Pipeline

Open your browser and go to localhost:5601. Kibana runs on this port. Once the interface loads, open the panel on the left and go to the Discover tab.

Click Create data view to specify which logs to display:

  • Enter a name, for example logs;

  • In the Index pattern field, enter flask-logs*. The asterisk means any index starting with flask-logs will be included;

  • Click Save data view.

Kibana will now display logs from the application. At this point, only the initial startup records appear.

Next, test the application by opening localhost:5050 in a new browser tab. Visiting pages creates log events in the container, which are processed by Filebeat and Logstash and displayed in Kibana. Go back to Kibana and click Refresh. Within 10–15 seconds, new logs appear, such as "User opened the home page" or "User clicked the button".

All containers are running, and the ELK pipeline is fully functional. Logs from the Flask app are collected, processed, and displayed in Kibana in real time. Your logging system is now ready to monitor and analyze application activity.

1. Which command correctly starts all containers defined in the Docker Compose file?

2. What port do you use to access Kibana in this setup?

question mark

Which command correctly starts all containers defined in the Docker Compose file?

Select the correct answer

question mark

What port do you use to access Kibana in this setup?

Select the correct answer

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 6
some-alt