Description
We just explored osctrl-admin and found that we can add a custom tag to each node/device. However, after added the custom tag, we cannot run a distributed query based on this tag. It would be great help if can also run the query based on these tags.
I would like to contribute to this feature, but I would like to know more details about the implementation.
In the architecture definition, the osctrl-admin should only talk to osctrl-api instead of the database directly. However, I found osctrl-admin would interact with the DB directly in many cases. I am completely fine with implementation and want to make sure if the rest of the changes are allowed to do so.
From the source code, I can see that currently it's based on four types of tags: env, platform, UUID and localname. I guess the easiest solution is to add an extra field so that we can pass the custom tags. What do you think?
Activity
javuto commentedon Oct 11, 2024
This is something that I had planned to implement since I added tags, not only for distributed queries but for file carves as well (they are technically a type of distributed query), see #76 and #77
I see two different implementations that can be done:
[-]Run distributed query based on custom tags[/-][+]Run distributed query/carve based on custom tags[/+]zhuoyuan-liu commentedon Oct 14, 2024
Hi @javuto , I have the following idea with Redis:
SMEMBERS
to retrieve tasks associated with a client.I think it's enough for us, but if you want to actively track how many nodes are unfished, we can create another Redis set to maintain a list of unfinished nodes for each query or just query logs returned by nodes.
Benefits:
zhuoyuan-liu commentedon Nov 5, 2024
With this change #558, it would be much easier to implement queries based on additional tags without significant performance impact.