Skip to content

Docker image to send message to Telegram when a log file event occurs.

Notifications You must be signed in to change notification settings

dickverbunt/log-to-telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log-to-telegram Docker

Docker Pulls

A docker container for reading growing log files and sending notifications via the telegram API based on items in a trigger list. Inspired by JVCubed/log-to-telegram. I mostly use it to send Pi-Hole events to Telegram.

Setup Docker run

  • Copy the config.yml

      $ docker run --rm --entrypoint cat dickverbunt/log-to-telegram  /app/config.yml > config.yml
    
  • Add TelegramBot api and chatID to config.yml

  • Add triggers to the list to config.yml

  • Run

      $ docker run -v {location of config.yml}:/app/config.yml -v {location of log file}:/app/file.log dickverbunt/logtotelegram
    
  • Ready! When a line gets added to the log file and matches a trigger it will send this to Telegram.

Docker compose

  • Copy the config.yml

      $ docker run --rm --entrypoint cat dickverbunt/log-to-telegram  /app/config.yml > config.yml
    
  • Add TelegramBot api and chatID to config.yml

  • Add triggers to the list to config.yml

  • Add to docker-compose.yml

log-to-telegram:
    image: dickverbunt/log-to-telegram
    container_name: log-to-telegram
    volumes:
      - /{path-to}/config.yml:/app/config.yml
      - /{path-to-log-file}:/app/file.log
    restart: unless-stopped
  • Run

      $ docker-compose up -d
    
  • Ready! When a line gets added to the log file and matches a trigger it will send this to Telegram.

Notes

  • In config.yml it's possible to edit the timeout period.
  • Logs will be printed to the terminal. There's also a /app/debug.log file.

About

Docker image to send message to Telegram when a log file event occurs.

Topics

Resources

Stars

Watchers

Forks

Languages