Netbox: Provide a diff showing the changes between two logged changes

Created on 10 Oct 2018  路  6Comments  路  Source: netbox-community/netbox

Environment

NetBox version: 2.4.6

Proposed Functionality

As a netbox user I would like to have the ability to compare the changes in object data between logged changes. This feature would be available within the changelog context of an object in the UI and have the ability to select two or more log entries and compare them against each other.

Use Case

This feature would be beneficial to users that want to quickly identify changes that have been made to an object rather than pulling the full object data and using it in an external tool to do a comparison.

As an example I created a screenshot that shows the differences between two versions of a device object. In this instance updating a serial number after it has been swapped out because it hypothetically had some sort of unrecoverable issue.

image

accepted feature

Most helpful comment

I have been working with django-dirtyfields lately and I think it would actually help with the fundamental issues that underpin this feature. It would also allow us to solve a couple of other problems like https://github.com/netbox-community/netbox/issues/3451 and preventing changelog entries and webhooks from being created when save is clicked on an instance but nothing was changed.

All 6 comments

@jeremystretch Thanks for adding this issue to the ever-growing backlog. I work for a small serviceprovider and we're in the process of evaluating Netbox. So I might raise some more issues in the near future but I'll try to keep it to a minimum.

My programming skills are near non-existent but you can expect my full commitment to test features as they are released. Thanks in advance and a big thumbs up for the awesome work you've done creating this amazing tool. :thumbsup:

Prior to the changelog functionality, I implemented something similar using dictdiffer. Works great, and has been quite useful.

In addition to that, maybe it would be possible to only create a changelog-entry (or save something at all) if settings changed. We had the case where a script updated various entries using the PATCH-method using the API and writing values to existing entries. But it didn't first download the current values and check if there was a difference. Maybe Netbox could detect that the diff was actually empty (all values already current) and then simply not creating a diff / an entry in the changelog.
Imho that works together with diffing old/new values, in a way.

Would like to see this functionality in the changelog UI as well. diff2html is a pretty popular npm module to accomplish the UI - https://github.com/rtfpessoa/diff2html | https://diff2html.xyz/

This might fit in easily with the recent changes from https://github.com/netbox-community/netbox/pull/3632

we now make a copy of the object being deleted and defer processing to until after the request has been completed

I have been working with django-dirtyfields lately and I think it would actually help with the fundamental issues that underpin this feature. It would also allow us to solve a couple of other problems like https://github.com/netbox-community/netbox/issues/3451 and preventing changelog entries and webhooks from being created when save is clicked on an instance but nothing was changed.

Maybe this could fix #3578 too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markve-sa picture markve-sa  路  4Comments

mrfroggg picture mrfroggg  路  3Comments

hellerve picture hellerve  路  3Comments

tyler-8 picture tyler-8  路  3Comments

Ali-Yazdani picture Ali-Yazdani  路  3Comments