Using Fluent-Bit to forward Docker PHP-FPM and Nginx logs to Elasticsearch

Using Fluent-Bit to forward Docker PHP-FPM and Nginx logs to Elasticsearch

Using Fluent-Bit to forward Docker PHP-FPM and Nginx logs to Elasticsearch. In this example we are going to forward our PHP-FPM and Nginx logs to Elasticsearch. In order to do that we will be using Fluent-Bit. Our monitoring stack is EFK (Elasticsearch Fluent-Bit Kibana).

In this example we are going to forward our PHP-FPM and Nginx logs to Elasticsearch. In order to do that we will be using Fluent-Bit. Our monitoring stack is EFK (Elasticsearch Fluent-Bit Kibana). The reason we are not using FileBeat and Logstash is because Fluent-Bit is very very light weight on system resources. We are talking about barely a few KB/MB compared to hundreds of MBs!!! It has build-in persistence mechanism as well such as memory and filesystem. FileBeat and Logstash solution will require something like Redis for persistence.

Flow

PHP-FPM and Nginx logs are being watched by Fluent-Bit then get forwarded to Elasticsearch. As simple as that!

docker elasticsearch nginx php-fpm

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Using Unix Socket for Php-fpm and Nginx Docker Setup

How to Using unix socket for php-fpm and nginx docker setup. Follow example below to use a unix socket configuration in order for PHP-FPM and Nginx docker containers to talk to each other. Both containers are running as same user inanzzz.

Creating A Simple PHP-FPM, Nginx and MySQL Application with Docker Compose

Learn how to Creating a simple PHP-FPM, Nginx and MySQL application with docker compose. You can use example below if you want to create a simple PHP-FPM, Nginx and MySQL application with docker compose.

PHP-FPM and Nginx access logs as standardised JSON string in Docker environment

Formatting PHP-FPM and Nginx access logs as standardised JSON string in Docker environment. If you want to change PHP-FPM and Nginx container log format to JSON while keeping same style, you can use example below.

Share Application Data with PHP-FPM and Nginx Docker Containers

Using a named volume and a data container to share application data with PHP-FPM and Nginx Docker containers. In this example we are going to use Docker's "(named) volumes" option to keep our application files/data. This option offers better security as opposed to "bind(shared) volumes" in production environment.

Multiple Dockerised PHP-FPM and Nginx Applications Communicating Each

Multiple dockerised PHP-FPM and Nginx applications communicating each other over the same network. In this example we are going to set up two dockerised PHP-FPM and Nginx applications ("frontend" and "backend") and allow them to communicate each other over the same network.