{# plugins/syslog/templates/syslog/patterns.html — telling phrases counted in each source's lines every minute, so an alert rule can watch them (#6001). #} {% extends "base.html" %} {% from "_macros.html" import crumbs, page_header, empty_state %} {% block title %}Patterns — Syslog — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Syslog", "/plugins/syslog/"), ("Patterns", "")]) }}{% endblock %} {% block content %} {% set admin = session.user_role == 'admin' %} {% set can_alert = session.user_role in ('admin', 'operator') %} {{ page_header("Patterns", (patterns|length ~ " pattern" ~ ("s" if patterns|length != 1 else "")) if patterns else none) }}

Counted

{% if admin %}New pattern{% endif %}

Each minute, every added source's lines matching a pattern in its window are counted. Alert on a count over 0 to hear of the first match; the alert clears once the window has passed it.

{% if not patterns %} {{ empty_state("No patterns yet. Add one of the ready-made ones below, or write your own.") }} {% else %} {% if can_alert %}{% endif %} {% for p in patterns %} {% if can_alert %} {% endif %} {% endfor %}
PatternMatchesWindowCount now
{{ p.name }}{% if not p.enabled %} (off){% endif %}
{{ p.metric }}
{% if p.phrases %}{{ p.phrases[:3]|join(" · ") }}{% if p.phrases|length > 3 %} · +{{ p.phrases|length - 3 }} more{% endif %}{% endif %} {% if p.severity %}
{{ p.severity }} and worse
{% endif %} {% if p.scope %}
from {{ p.scope }} only
{% endif %}
{{ p.window }} min {% if not p.counts %}No added source {% else %}{% for c in p.counts %}
{{ "—" if c.value is none else c.value }} {{ c.source }}
{% endfor %}{% endif %}
{% if p.alert_resource %}Alert on it{% endif %} {% if admin %}Edit{% endif %}
{% endif %}
{% if admin and presets %}

Ready-made

How NAS and Linux kernels word storage trouble. Add one, then change its phrases if your devices word it differently.

{% for p in presets %} {% endfor %}
{{ p.name }}
{{ p.about }}
{{ p.phrases|join(" · ") if p.phrases else "err, crit, alert or emerg" }}
{{ csrf_field() }}
{% endif %} {% endblock %}