Watchlist: Custom Log Monitoring

Monitor any log file in real time by defining custom watchlists and parsing rules.

1. Install Watchlog Agent

2. Configure Watchlist

In your project directory, create or open log-watchlist.json and define the logs to monitor:


  {
    "logs": [
      {
        "name": "Nginx Access Logs",
        "path": "/var/log/nginx/access.log",
        "service": "nginx",
        "format": "auto"
      },
      {
        "name": "Redis Logs",
        "path": "/var/log/redis/redis.log",
        "service": "redis",
        "format": "custom",
        "pattern": "^(\\d{2} \\w{3} \\d{2}:\\d{2}:\\d{2}) (\\w+): (.*)$"
      }
    ]
  }
  

Then restart the agent to apply changes:

Linux Restart

pm2 restart watchlog-agent

Windows Restart

Restart-Service -Name "WatchlogAgent"

Understanding Format & Pattern

  • auto: Watchlog auto-detects common formats (e.g., Nginx, Redis).
  • custom: Provide a pattern regex to extract timestamp, level, and message.

Example regex extracts date, level, and message:

"^(\\d{2} \\w{3} \\d{2}:\\d{2}:\\d{2}) (\\w+): (.*)$"

There is no limit to the log levels you can use. For example: INFO, WARN, ERROR, DEBUG, NOTICE, CRITICAL, SUCCESS, or any other string recognized in the level group.

Key Watchlist Features

Search Logs

Quickly find entries by keyword across all monitored logs in real time.

Filter by Levels & Time

Apply filters by log level or custom date ranges for focused analysis.

Live Mode

Enable real-time updates to watch incoming log entries without refreshing.

Interactive Charts

Visualize log volume and level distribution with dynamic charts.

Level Parsing

Automatically detect and categorize levels (INFO, ERROR, DEBUG, etc.) or define custom patterns.

Start Monitoring Logs