Skip to content

waiphyodev/postgresql-efk-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgresql-efk-stack

  1. specify postgresql.conf to store log file as postgresql.log under log folder of root
log_destination = 'stderr'
logging_collector = on
log_statement = all
log_directory = '/log'
log_filename = 'postgresql.log'
  1. -v ${PWD}/postgres-data/log:/log:Z is mounting postgresql.log from container to host and -v ${PWD}/postgresql.conf:/etc/postgresql/postgresql.conf:Z is mounting postgresql.conf from host to container
podman run -d --rm \
  --name postgres-test \
  -v ${PWD}/postgres-data/log:/log:Z \
  -v ${PWD}/postgresql.conf:/etc/postgresql/postgresql.conf:Z \
  -e POSTGRES_PASSWORD=password \
  postgres \
  -c 'config_file=/etc/postgresql/postgresql.conf'
  1. specify fluent-bit.conf to collect log from its own mounted from host
[SERVICE]
    Flush         5
    Log_Level     info
    Daemon        off

[INPUT]
    Name          tail
    Path          /var/log/postgresql.log

[OUTPUT]
    Name          stdout
    Match         *
  1. -v ${PWD}/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:Z is mounting config file to container and -v ${PWD}/postgres-data/log/postgresql.log:/var/log/postgresql.log:Z is mounting postgresql.log which exposed from postgres container to fluent-bit
podman run -d --rm \
  --name fluent-bit \
  -v ${PWD}/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf:Z \
  -v ${PWD}/postgres-data/log/postgresql.log:/var/log/postgresql.log:Z \
  fluent-bit:latest

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors