{% extends 'base/layout.html' %} {% load form_helpers %} {% block title %}Loki Settings{% endblock %} {% block header %}

Loki Plugin Settings

{% endblock header %} {% block content %}
Loki Configuration
Note: Settings are configured in NetBox's configuration.py or plugins.py. This page shows the active settings shape and lets you test the current connection.
{% csrf_token %}
Connection Settings
{{ form.loki_url }} {{ form.loki_url.help_text }}
{{ form.loki_external_url }} {{ form.loki_external_url.help_text }}
{{ form.loki_tenant }} {{ form.loki_tenant.help_text }}
{{ form.loki_username }} {{ form.loki_username.help_text }}
{{ form.loki_password }} {{ form.loki_password.help_text }}
{{ form.loki_bearer_token }} {{ form.loki_bearer_token.help_text }}

Query Settings
{{ form.loki_job }} {{ form.loki_job.help_text }}
{{ form.device_label }} {{ form.device_label.help_text }}
{{ form.stream_selector }} {{ form.stream_selector.help_text }}
{{ form.log_limit }} {{ form.log_limit.help_text }}
{{ form.time_range }} {{ form.time_range.help_text }}
{{ form.timeout }} {{ form.timeout.help_text }}
{{ form.cache_timeout }} {{ form.cache_timeout.help_text }}

Matching Options
{{ form.verify_tls }}
{{ form.verify_tls.help_text }}
{{ form.use_regex_matching }}
{{ form.use_regex_matching.help_text }}
{{ form.fallback_to_ip }}
{{ form.fallback_to_ip.help_text }}
Connection Test

Test connectivity to the Loki API using the active NetBox configuration.

Configuration Help

Add to configuration.py or plugins.py:

PLUGINS = ['netbox_loki']

PLUGINS_CONFIG = {
    'netbox_loki': {
        'loki_url': 'http://loki:3100',
        'loki_external_url': 'https://grafana.example.com/explore',
        'loki_tenant': 'docker',
        'loki_job': 'syslog',
        'device_label': 'routerboard',
        'stream_selector': '',
        'fallback_to_ip': True,
    }
}
Loki API Docs
{% endblock %}