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.0.tar.gz (23.7 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.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: netbox_history-0.1.0.tar.gz
  • Upload date:
  • Size: 23.7 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.0.tar.gz
Algorithm Hash digest
SHA256 004ce20a5197caf6a8eb2705c9cb0648f8e4dc4034ca8babf4308f861632a166
MD5 e09958aa494e2161b063b080089bc46c
BLAKE2b-256 6c6bdf01b37e2dee9b8397e945072c81a594bd3c8c39d2c5cfca8e83d1b4fc89

See more details on using hashes here.

File details

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

File metadata

  • Download URL: netbox_history-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 26.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73d11bbc512204724d911bbb11067e6b737073622e083715c94ef1bbd56d3596
MD5 0116947152d89ea85d10987a7b87d311
BLAKE2b-256 7b868996db4f0bafc2e64cfc2b943fde5dfd529dc3889435134afc7a9f550bee

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