Skip to content

Config Structure

The config.yaml file is divided into four main sections:

  1. settings: Global settings for the whole program (Optional since they all have default values)
  2. notifications: Configure ntfy, apprise and/or a custom webhook
  3. containers: Define which Containers to monitor and their specific Keywords (plus optional settings).
  4. 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 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 when you start LoggiFly for the first time.

Config Template
yaml
# ===========================================
#                CONFIG TEMPLATE
# ===========================================
#
# This is a template for your config.yaml file.
#
# Remove any sections you don't need.
# After editing, rename this file to config.yaml to use it.
#
# For LoggiFly to work, you need to:
#   - Configure at least ONE container
#   - Add at least ONE keyword/regex (globally or per container)
#
# Each container example below shows more configuration options.
#
# For more configuration options like OliveTin actions or notification customization, 
# visit the docs: https://clemcer.github.io/loggifly
#
# ===========================================

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
      - keyword_group:           # When all of these keywords are found in a log line, a notification is sent
        - keyword3
        - keyword4
        - keyword5

  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
    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

#  Default settings (can be overridden on container or keyword level)
settings:          
  log_level: INFO                        # DEBUG, INFO, WARNING, ERROR
  multi_line_entries: True               # Catch log entries that span multiple lines 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).