Skip to main content

Search NetBox changelog snapshots by field value, including deleted objects

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_history-0.1.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_history-0.1.1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file netbox_history-0.1.1.tar.gz.

File metadata

  • Download URL: netbox_history-0.1.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for netbox_history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 98872924acc4d7531fbb0b20ed44e2451a4ccd9eaf5f5c68d8abef2f0c588f5e
MD5 a1615e9155e8a0372229a030490e07b4
BLAKE2b-256 28cab41818ba85aa923956708bcd8a820299a39ffe3f32c2ac5045f327201faf

See more details on using hashes here.

File details

Details for the file netbox_history-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: netbox_history-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for netbox_history-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db886141adcf90b30f0f60eece33bb9306b2de72dc969a3ce3dc3b2debb76421
MD5 b89380c47f02917e779bbb4d8db430f5
BLAKE2b-256 f49495fbb41994cef2d2e3a3c195f2cfa06b21eb44c6aafc290ecd6a6bad19be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page