-
Notifications
You must be signed in to change notification settings - Fork 67
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
import-beats: Decode fields layerListJSON, mapStateJSON #354
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, Kibana only supports encoded objects. If we change this list, we also need to change it here: https://github.com/elastic/package-registry/blob/master/dev/generator/main.go#L253
Storing it decode is for versioning purpose to be able to review diffs. This is something specific to packages.
"attributes.optionsJSON", | ||
"attributes.panelsJSON", | ||
"attributes.kibanaSavedObjectMeta.searchSourceJSON", | ||
"attributes.uiStateJSON", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is encoded and decode not the same list?
Could you import this list from here https://github.com/elastic/package-registry/blob/master/dev/generator/main.go#L253 so we have a single point of truth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the same list, because some fields are already encoded in dashboards stored in Beats (see mapStateJSON in https://github.com/elastic/beats/blob/master/x-pack/filebeat/module/o365/_meta/kibana/7/dashboard/Filebeat-O365-Audit.json#L842).
Another solution would be detecting if the field is "string" and then try to decode it. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. So we basically missed it already in Beats, I wonder if we should add it there @exekias .
A check for string would be nice as it would mean we only have to keep one list and things to break if the dashboards in Beats itself are adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
I responded in the other comment. |
Your code changes LGTM but you still have to update https://github.com/elastic/package-registry/blob/master/dev/generator/main.go#L253 with the new saved object list as otherwise the packages will be broken. I suggest we merge the two into 1, one using the other. |
Fixed, but I will keep merging aside not to introduce dependency between dev tools. |
For linking, found the issue related to encoding objects in Kibana: elastic/kibana#43673 |
This PR decodes two Kibana fields that have been already encoded in Beats: layerListJSON, mapStateJSON.
It's a followup of the PR comment: #352 (comment)
Actually I'm not sure if we should store them decode, could somebody from the Kibana team confirm that's correct?