Skip to main content

netbox-history

A NetBox plugin that searches changelog snapshots by field value — including data from objects that have since been deleted.

When a NetBox object is deleted, its data disappears from the primary tables but lives on in core.ObjectChange as serialized JSON in prechange_data / postchange_data. NetBox's built-in changelog UI only filters by object type and primary key — not by arbitrary field values inside the snapshot. This plugin adds a UI search view and a REST API over those snapshots.

It adds no database models and requires no migrations — it is a pure search-and-display layer over core.ObjectChange.

Requirements

  • NetBox >= 4.5.0 (tested through the 4.6.x line)
  • Python >= 3.12

Installation

pip install -e .

Add the plugin to your NetBox configuration.py:

PLUGINS = ['netbox_history']

Restart NetBox. No migrations are required.

Usage

UI

Navigate to Plugins → History → History Search. Choose an object type and field, enter a value, pick a match mode (Contains / Exact), and optionally a date range. Results show the searched field's before/after values alongside the standard changelog columns.

REST API

Method Endpoint Purpose
GET /api/plugins/history/models/ List searchable models
GET /api/plugins/history/models/<model>/ Field structure for a model (case-insensitive)
POST /api/plugins/history/search/ Execute a changelog search

Example search request:

{
  "model": "IPAddress",
  "query": {"field": "dns_name", "match_type": "partial", "search_text": "myhost"},
  "max_results": 100,
  "search_history_days": 30
}

Adding searchable models

Edit netbox_history/registry.py and add an entry to SEARCHABLE_FIELDS, keyed by "<app_label>.<model_name>". Include only simple string/choice fields that appear as direct keys in the JSON snapshot (foreign-key fields serialize as integer IDs and are not useful to search).

License

This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See the LICENSE file for the full text.

Metadata

Release files for netbox-history 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-history 0.1.1
File Size Uploaded
netbox_history-0.1.1.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netbox-history 0.1.1
File Interpreter ABI Platform
netbox_history-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 53.8 kB

Release files / netbox_history-0.1.1.tar.gz

Download URL netbox_history-0.1.1.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
98872924acc4d7531fbb0b20ed44e2451a4ccd9eaf5f5c68d8abef2f0c588f5e
BLAKE2b-256 checksum
How to use checksums
28cab41818ba85aa923956708bcd8a820299a39ffe3f32c2ac5045f327201faf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / netbox_history-0.1.1-py3-none-any.whl

Download URL netbox_history-0.1.1-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db886141adcf90b30f0f60eece33bb9306b2de72dc969a3ce3dc3b2debb76421
BLAKE2b-256 checksum
How to use checksums
f49495fbb41994cef2d2e3a3c195f2cfa06b21eb44c6aafc290ecd6a6bad19be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page