{% extends 'admin/master.html' %} {% block body %}

Debug: {{ hostname or 'pick a host' }}

{% if output is mapping %} {% set outcomes = output.get('Outcomes') %} {% set filtered = output.get('Filtered') %} {% set custom = output.get('Custom Attributes') %} {% set full_attrs = output.get('Full Attribute List') %} {% set disabled_info = output.get('Info: Host disabled by Filter', 'MISSING') %} {% macro render_kv(items) %} {% if items %}
{% for k, v in items.items() %}
{{ k }} {{ v }}
{% endfor %}
{% else %}
No entries.
{% endif %} {% endmacro %} {# --- Primary summary: Outcomes + Filtered, both expanded --- #}
Outcomes Actions that will fire for this host
{% if outcomes is mapping %} {{ render_kv(outcomes) }} {% elif outcomes %}
{{ outcomes }}
{% else %}
{% if disabled_info != 'MISSING' %} Host is disabled by a filter rule — no outcome is produced. See the Rules section below. {% else %} No outcome data for this host. {% endif %}
{% endif %}
Filtered Labels After filter / rewrite rules
{{ render_kv(filtered) if filtered else '
No filter/rewrite rules apply — same as full attribute list below.
' | safe }}
{# --- Custom Attributes, only when present --- #} {% if custom %}
Custom Attributes From CustomAttributeRule
{{ render_kv(custom) }}
{% endif %} {# --- Rules drill-down (collapsed accordion by rule group) --- #} {% if rules %} {% set condition_types = { 'equal': "exact match", 'in': "contains", 'not_in': "not contains", 'in_list': "value in your list", 'string_in_list': "string in Python list", 'ewith': "ends with", 'swith': "starts with", 'regex': "regex match", 'bool': "boolean match", 'ignore': "always match" } %} {% set negate = { true: 'not ', false: ' ' } %}
Rules Per-rule match details (click a group to expand)
{% for rule_name, rule_raw in rules.items() %} {% set hit_count = rule_raw | selectattr('hit') | list | length %} {% endfor %}
{% for rule_name, rule_raw in rules.items() %}
{% for rule in rule_raw %} {% endfor %}
Rule Hit First reason the rule won't match Condition Type Last Match
{% if rule['rule_url'] %} {{ rule['name'] }} {% else %} {{ rule['name'] }} {% endif %} {% if rule['hit'] %} {% else %} {% endif %} {% if rule['no_match_reason'] %} {% set no_match = rule['no_match_reason'] %} {% if no_match['match_type'] == 'host' %} {{ negate[no_match['hostname_match_negate']] }}{{ condition_types[no_match['hostname_match']] }} {{ no_match['hostname'] }} {% else %} {{ negate[no_match['tag_match_negate']] }}{{ condition_types[no_match['tag_match']] }} {{ no_match['tag'] }} = {{ negate[no_match['value_match_negate']] }}{{ condition_types[no_match['value_match']] }} {{ no_match['value'] }} {% endif %} {% endif %} {{ rule['condition_type'] }} {{ rule['last_match'] }}
{% endfor %}
{% endif %} {# --- Full Attribute List (collapsed by default) --- #} {% if full_attrs %}
Full Attribute List (raw) All host labels before filter — click to expand
{{ render_kv(full_attrs) }}
{% endif %} {% elif hostname %}
{{ output }}
{% endif %}
{% endblock %}