Invalid collector_id on Sidecar Collector configuration content Pack creation
Hi, i'm using Graylog 4.1.6 and I found something strange when I generate a contentPack where I select my Sidercar Collector Confoguration. In the json file, I found a tag where is present the collector_id:
"collector_id": { "@type": "string", "@value": "1a2fdb07-9065-4f0a-8c21-46b4be064170" },
whell the id value does not match with no collector that I can see using API Rest.

The correct collector id has a different value. This bug means that If I cut&past the same collector configuration, changing the name and other attribute values, I cannot use it as a valid contentPack to import in the same enviroment.
The imported object as not valid collector configuration match

Probablly it is a bug. Is there something that I can do as workaround to fix this problem?
@gianluca-valentini The ID values in content packs are "logical" IDs and not the actual database IDs. When the content pack is installed, the content pack system resolves those IDs to real database IDs.
Unfortunately, I don't understand what you are trying to do yet. Can you please elaborate on your use case and what exactly you are trying to do that doesn't work? Thank you!
Hi, thanx for your answer. My scenario is this: I'd like to import a collector configuration. Starting from another one (changing the name and file input and other attributes) I was sure to be able to assign the correct collector too. The problem with the Id means that I cannot do it but I have to go to the graylog gui and set it manually.
So the import does not work too because the same collector configuration after delete/import does not set the correct beat configuration
Hi @bernd let me try to explain better my situation.
I need to import some sidecar collector configuration starting from one that I already create manually. So the only step that I can use is the configuration import using content pack but the collector_id found on export operation is not valid. So I cannot complete the import because a user action is required to fix it using the graylog gui

@gianluca-valentini Thanks for the update. I was able to reproduce the issue with the following steps:
- Create a custom "Log Collector"
- Create a custom "Configuration" and use the newly created custom log collector for the configuration
- Create a new content pack, selecting the created configuration and log collector
- Delete the collector configuration and the log collector
- Install the newly created content pack
- Observe the installed Sidecar configuration showing "Unknown collector"
The problem is that the code is using the logical ID of the log collector instead of looking up the database ID of the created log collector during the content pack installation here:
https://github.com/Graylog2/graylog2-server/blob/36d3a2dad84d65b15405a4412195cce1031076d2/graylog2-server/src/main/java/org/graylog2/contentpacks/facades/SidecarCollectorConfigurationFacade.java#L95
The code needs to get the actual database ID from the nativeEntities parameter in SidecarCollectorConfigurationFacade#createNativeEntity().
@bernd is there any news?