chaoss / grimoirelab-elk

GNU General Public License v3.0
60 stars 121 forks source link

Strange support for custom fields in meta fields of projects.json #678

Closed jsmanrique closed 5 years ago

jsmanrique commented 5 years ago

I have a projects.json file that include some custom fields inside the meta field like:

"meta": {
    "title": "Awesome Project",
    "type": "Software"
},

In the data discovery tab I see expected cm_title and cm_type fields with the right data. But cm_type cannot be visualized, because it's not in the index pattern. cm_title appears as field with type text.

Would it be great adding any custom field in meta to the index pattern as cm_{custom field name} with type text.

valeriocos commented 5 years ago

Thank you for reporting this issue! Which index(es) are you referring to?

valeriocos commented 5 years ago

A workaround is to refresh the index patterns in kibana, after that you will see the missing fields. I guess the reason of not having cm_* fields in the index patterns is due to the fact that they are custom fields, and thus they are not present by default. Please @alpgarcia share your opinion, thanks

jsmanrique commented 5 years ago

Thank you @valeriocos, that helped. Let's wait for @alpgarcia comments

alpgarcia commented 5 years ago

This is probably out of the scope of Gelk. This happens when Mordred uploads standard index patterns from Sigils, so any custom field will either not be present or disappear from the index pattern (if you manually added them to the index pattern).

The only way to support this would be checking the projects.json file after uploading standard index patterns and dynamically add custom fields to Kibana index pattern object. That means uploading an index pattern to the dashboard should trigger this check to make sure custom fields are always kept.

Custom fields could be modified in the index pattern by the user, so we couldn't simply overwrite the index pattern and then add them, but we will also need to keep those changes. So, should we consider custom an index pattern having custom fields? (and thus not updating that index pattern and the affected panels anymore)

alpgarcia commented 5 years ago

I'm closing this issue here as Gelk can't handle this. Please open a similar one in sirmordred if needed.