-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to access nested JSON MQTT data #2992
Comments
Hi @acpenela, thanks for opening this issue. Nested structures are not completely supported in all StreamPipes components. However, you can flatten the events in the adapter, enabling you to move nested properties to the top level. In the schema editor (as shown in your screenshot), you can drag and drop the entries to the top level, placing them next to the timestamp. As a result your event shoud look like this:
If you encounter any issues during this process, please let us know. Additionally, we are planning to include a flatten feature in the adapter to assist you with this process in the future. It is also possible to change the Cheers, |
@tenthe Can you show exactly how you do that? I am not able to flatten a JSON structure in the adapter in any way. Dragging the elements to the root does not cause a transformation in the output. |
Hi @KunJakob, When I adjusted the structure using drag and drop, my event in the preview broke. Is this the same issue you're experiencing? |
@tenthe thats exactly what I've had, yes! |
Apache StreamPipes version
Other StreamPipes version (please specify below)
Affected StreamPipes components
Processing Elements
What happened?
When a MQTT adapter with a nested JSON data format is configured and started, the data isn't accessible in the pipeline nor possible to visualize in Dashboard.
Data schema configuration:
Live preview of the data:
![Screenshot 2024-07-02 at 14 57 21](https://private-user-images.githubusercontent.com/174210337/345059913-87a847df-5f45-4b95-aaeb-0f06fa2f9137.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5OTIyMzAsIm5iZiI6MTczOTk5MTkzMCwicGF0aCI6Ii8xNzQyMTAzMzcvMzQ1MDU5OTEzLTg3YTg0N2RmLTVmNDUtNGI5NS1hYWViLTBmMDZmYTJmOTEzNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQxOTA1MzBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05NTgzYWZhMDA1MjJjODY1YjFjZmJmNzBmYWMzNmRjYjY0NTc4MTA3ZmJmZDAxMzhlZDA2YjQzMDk2ZDNiMTk4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AgL6dVNhPI6kfdoYuO1KywP7RxjHloacXc6bZ3iOmkY)
Even using a pipeline element, such as javascript eval, we cannot access the properties of nested objects.
When creating dashboard visualizations, it´s not possible to access values from nested object properties.
How to reproduce?
Create a MQTT adapter in Streampipes with nested JSON data. In the pipeline try to view (using live preview) or access atribute values in the pipeline. After creating and starting both the adapter and the pipeline, try visualize object property values in dashboard visualizations.
Expected behavior
In the pipeline access values from nested object attributes.
In the Dashboard, access and visualize data using nested objects.
Additional technical information
Streampipes version - 0.95.0
On a dashboard, if we select the raw widget to display the message, the nested objects appear as java.util.map, which implies that they are passing through the pipeline , but we have no way of accessing the data.
Are you willing to submit a PR?
No, I don't want to submit a PR.
The text was updated successfully, but these errors were encountered: