Skip to content

Conversation

@lgdacunh
Copy link
Contributor

Added support to jq filter directly in configuration file. Added wildcard support for Telemetry Object version.

Added support to jq filter directly in configuration file.
Added wildcard support for Telemetry Object version.

Signed-off-by: Leonardo da Cunha <[email protected]>
/* Create jq command and pipe JSON through it */
snprintf(cmd, sizeof(cmd), "jq -r '%s'",
jq_filter_str);
jq_pipe = popen(cmd, "w");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this a bit a wild feature, there are pipes for this?

$ nvme ... | jq

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have being sharing configuration files, jq filter files, and instructions to use the command line pipe with our customers. Some customers have to manage multiple configuration files and multiple jq filters, for different products or use cases.
When we have to iterate over some issue to get the most suitable output... file exchange and management goes crazy.
Embedding one or multiple filters in the configuration file reduces the file management overhead on our side and on the customer side.
The same applies to the wildcard support. It allows support for multiple products through the same configuration file
I would prefer to embed libjq over the pipe implementation, but I imagine this would trigger some extensive discussions that feels too early to have.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@igaw, I understand your suggestion is to keep jq filters in separate files and pipe them via the command line. However, in practice this approach requires managing multiple files—configuration files, filter files, and shell scripts—which creates significant overhead for both our team and customers. By embedding filters directly in the configuration file, we eliminate this complexity and allow a single file to handle multiple products and use cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really think this is going into the wrong direction in the long run. It contradicts the design principle for a command line tool in Unix/Linux IMO.

Though, I am not maintaining this plugin, thus it's your problem :)

BTW, I don't have a real problem with adding additional library dependencies as long we keep them optional. Obvious less dependency is better but if you have a good use case for I am okay with it.

@igaw igaw merged commit 93ea93e into linux-nvme:master Jan 12, 2026
20 checks passed
@igaw
Copy link
Collaborator

igaw commented Jan 12, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants