Config Structure ā
The config.yaml
file is divided into four main sections:
settings
: Global settings for the whole program (Optional since they all have default values)notifications
: Ntfy (URL, Topic, Token, Priority and Tags), your Apprise URL and/or a custom webhook urlcontainers
: Define which Containers to monitor and their specific Keywords (plus optional settings).global_keywords
: Keywords that apply to all monitored Containers.
IMPORTANT
For the program to function you need to configure:
- at least one container
- at least one notification service (Ntfy, Apprise or custom webhook)
- at least one keyword / regex pattern (either set globally or per container)
The rest is optional or has default values.
Config Template ā
Here is an example config. This file automatically gets downloaded into your mounted /config
directory.
Config Template
yaml
# ===========================================
# CONFIG TEMPLATE
# ===========================================
#
# This is a template for your config.yaml file.
#
# For LoggiFly to work, you need to:
# - Configure at least ONE container
# - Set up at least ONE notification service (Ntfy or Apprise)
# - Add at least ONE keyword/regex (globally or per container)
#
# Optional: Remove any sections you don't need.
# After editing, rename this file to config.yaml to use it.
#
# Each container example below shows more configuration options.
#
# Notification customization is not included here.
# For details, visit:
# https://clemcer.github.io/loggifly/guide/customize-notifications/
#
# ===========================================
containers:
container1: # (Example) Leave blank if you only need global keywords
container2:
keywords:
- keyword1 # Simple keyword
- regex: regex-pattern1 # Use this for regex patterns
- keyword: keyword2 # Another way to set a simple keyword
container3:
keywords:
- keyword: keyword1
attach_logfile: true # Attach a log file to the notification
- regex: regex-pattern1
action: restart # Restart container on this regex match
- keyword: keyword2
action: stop # Stop container on this keyword
# You can set many settings per container or per keyword!
# See all options: https://clemcer.github.io/loggifly/guide/settings-overview
container4:
apprise_url: "discord://webhook-url"
ntfy_tags: closed_lock_with_key
ntfy_priority: 5
ntfy_topic: container3
webhook_url: https://custom.endpoint.com/post
attachment_lines: 50
notification_title: '{keywords} found in {container}'
notification_cooldown: 2
attach_logfile: true
action_cooldown: 60
hide_regex_in_title: true
keywords:
- keyword1
- keyword2
- regex: regex-pattern1
ntfy_tags: closed_lock_with_key
ntfy_priority: 5
ntfy_topic: regex-pattern1
attachment_lines: 10
hide_regex_in_title: false
- keyword: keyword3
apprise_url: "discord://another-webhook-url"
action: restart
action_cooldown: 60
notification_title: 'custom title'
notification_cooldown: 10
attach_logfile: true
# Global keywords apply to ALL containers
global_keywords:
keywords:
- global_keyword1
- regex: regex1
attach_logfile: true
notifications:
# At least one of these (Ntfy/Apprise/Webhook) is required.
ntfy:
url: http://your-ntfy-server # Required: Ntfy instance URL
topic: loggifly # Required: Ntfy topic
token: ntfy-token # Optional: Ntfy token for auth
username: john # Optional: Username for auth
password: password # Optional: Password for auth
priority: 3 # Ntfy priority (1-5)
tags: kite,mag # Ntfy tags/emojis
apprise:
url: "discord://webhook-url" # Any Apprise-compatible URL
webhook:
url: https://custom.endpoint.com/post
headers: # Optional: Add custom headers
Authorization: "Bearer token"
X-Custom-Header": "Test123"
# Default settings (can be overridden on container or keyword level)
settings:
log_level: INFO # DEBUG, INFO, WARNING, ERROR
multi_line_entries: True # Monitor and catch multi-line log entries instead of going line by line.
reload_config: True # Auto-reload config on changes
disable_start_message: False # Suppress startup notification
disable_shutdown_message: False # Suppress shutdown snotification
disable_config_reload_message: False # Suppress config reload notification
disable_container_event_message: False # Suppress container start/stop notifications
# The following settings can also be set per container or per keyword/regex pattern
notification_cooldown: 5 # Seconds between alerts for same keyword (per container)
notification_title: default # Custom template for notification title
action_cooldown: 300 # Cooldown (seconds) before next container action (min 60s)
attach_logfile: False # Attach log file to all notifications
attachment_lines: 20 # Lines to include in log attachments
hide_regex_in_title: False # Hide regex in notification title
excluded_keywords: # List of keywords that will always be ignored in log lines. (https://clemcer.github.io/loggifly/guide/config_sections/settings.html#excluded-keywords).
Config Example ā
Here is an example config with some real use cases.
Config Example with Use Cases
yaml
# ===========================================
# CONFIG EXAMPLE
# ===========================================
#
# This is an example config.yaml file for loggifly.
#
# If you want to use this file after editing it make sure to rename it to config.yaml
#
# Feel free to contribute to the containers section of this example config with use cases you have found helpful :)
containers:
audiobookshelf:
ntfy_topic: abs
ntfy_tags: books, headphones
notification_cooldown: 5
notification_title: "{container}" # hide found keywords from notification title
keywords:
# user requested download:
- regex: '(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}).*User "(?P<user>[A-Za-z\s]+)" requested download for item "(?P<item>[A-Za-z\s]+)"'
template: '\nš The user {user} requested download for ''{item}''!\nš {timestamp}'
# user was online
- regex: '(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}).*Socket.*disconnected from client "(?P<user>[A-Za-z\s]+)"'
template: '\nš The user {user} was seen!\nš {timestamp}'
# Failed Login attempt
- regex: '(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{3}).*Failed login attempt for username "(?P<user>[A-Za-z\s]+)" from ip (?P<ip_address>\d{1,3}(?:\.\d{1,3}){3})\s+\((?P<error>[A-Za-z\s]+)\)'
template: 'šØ Failed login!šāāļø\nUsername: ''{user}''\nš IP Address: {ip_address}\nš {timestamp}'
- podcast
- regex: User.*logged in # when a user logs in
- failed login # Failed login to the web interface
- Error in openid callback # Error when trying to login with OIDC
vaultwarden:
ntfy_tags: closed_lock_with_key
ntfy_priority: 5
ntfy_topic: security
notification_cooldown: 0
keywords:
- regex: '(?P<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}).*Username or password is incorrect. Try again. IP: (?P<ip_address>\d{1,3}(?:\.\d{1,3}){3}). Username: (?P<email>[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})'
template: 'šØ Failed login!\nš§ Email: ''{email}''\nš IP Address: {ip_address}\nš {timestamp}'
hide_pattern_in_title: true # Hide full regex pattern in notification title
ebook2audiobook:
attachment_lines: 300
keywords:
- 100%
- sentence
- converting
- keyword: total audio parts saved to
attach_logfile: true # Attach a log file to the notification
authelia:
ntfy_topic: security
keywords:
- regex: \bsuccessful.*authentication
json_template: '{msg}\nš IP: {remote_ip}\n{time}'
- keyword: user not found
json_template: 'šØ Somebody tried to log in with a username that does not exist\n\nš{time}\nFull Error Message:\n{msg}'
adguard:
attach_logfile: true # Attach a log file to the notification
attachment_lines: 100
ntfy_topic: adguard
keywords:
- failed
- error
kitchenowl:
keywords:
- keyword: traceback
action: stop # I have had container restart loops because kitchenowl couldn't connect to my Authentik Server
global_keywords:
keywords:
- keyword: panic
attach_logfile: true # Attach a log file to the notification
- keyword: fatal
ntfy_topic: fatal-errors
notifications:
# At least one of these (Ntfy/Apprise/Webhook) is required.
ntfy:
url: http://your-ntfy-server # Required. The URL of your Ntfy instance
topic: loggifly # Required. the topic for Ntfy
token: ntfy-token # Ntfy token in case you need authentication
username: john # Ntfy Username + Password in case you need authentication
password: password # Ntfy Username + Password in case you need authentication
priority: 3 # Ntfy priority (1-5)
tags: kite,mag # Ntfy tags/emojis
apprise:
url: "discord://webhook-url" # Any Apprise-compatible URL (https://github.com/caronc/apprise/wiki)
webhook:
url: https://custom.endpoint.com/post
headers: # add headers if needed
Authorization: "Bearer token"
X-Custom-Header": "Test123"
# Default settings (can be overridden on container or keyword level)
settings:
log_level: INFO # DEBUG, INFO, WARNING, ERROR
multi_line_entries: True # Monitor and catch multi-line log entries instead of going line by line.
reload_config: True # Auto-reload config on changes
disable_start_message: False # Suppress startup notification
disable_shutdown_message: False # Suppress shutdown notification
disable_config_reload_message: False # Suppress config reload notification
disable_container_event_message: False # Suppress container start/stop notifications
notification_cooldown: 5 # Seconds between alerts for same keyword (per container)
notification_title: default # Custom template for notification title
action_cooldown: 300 # Cooldown (seconds) before next container action (min 60s)
attach_logfile: False # Attach log file to all notifications
attachment_lines: 20 # Lines to include in log attachments
hide_regex_in_title: False # Hide regex in notification title
excluded_keywords: # List of keywords that will always be ignored in log lines.
- keyword: ignore this message
INFO
Feel free to contribute your use cases to the file.