Provide a diff showing the changes between two logged changes #2061

Closed
opened 2025-12-29 17:21:53 +01:00 by adam · 6 comments
Owner

Originally created by @swerveshot on GitHub (Oct 10, 2018).

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

Originally created by @swerveshot on GitHub (Oct 10, 2018). ### 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](https://user-images.githubusercontent.com/10358044/46728971-59d9de80-cc84-11e8-8003-1ac587cf2a01.png)
adam added the status: acceptedtype: feature labels 2025-12-29 17:21:53 +01:00
adam closed this issue 2025-12-29 17:21:53 +01:00
Author
Owner

@swerveshot commented on GitHub (Oct 11, 2018):

@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. 👍

@swerveshot commented on GitHub (Oct 11, 2018): @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:
Author
Owner

@ebusto commented on GitHub (Nov 6, 2018):

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

@ebusto commented on GitHub (Nov 6, 2018): Prior to the changelog functionality, I implemented something similar using [dictdiffer](https://dictdiffer.readthedocs.io/en/latest/). Works great, and has been quite useful.
Author
Owner

@neufeind commented on GitHub (Nov 28, 2018):

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.

@neufeind commented on GitHub (Nov 28, 2018): 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.
Author
Owner

@bcohee commented on GitHub (Oct 30, 2019):

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

@bcohee commented on GitHub (Oct 30, 2019): 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
Author
Owner

@lampwins commented on GitHub (Feb 18, 2020):

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.

@lampwins commented on GitHub (Feb 18, 2020): I have been working with [django-dirtyfields](https://github.com/romgar/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.
Author
Owner

@tb-killa commented on GitHub (Feb 19, 2020):

Maybe this could fix #3578 too?

@tb-killa commented on GitHub (Feb 19, 2020): Maybe this could fix #3578 too?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2061