rfarley3 / Kibana

Kibana 4 configuration index interaction (.kibana index control, import and export of config, dashboards, visualizations, searches)
MIT License
18 stars 15 forks source link

in mapping, type having "float" as value would be also convert to "number" #9

Closed Moosh-be closed 8 years ago

Moosh-be commented 8 years ago

context

when I generate a new index pattern there is 2 attributes

geoip.longitude and geoip.latitude wich are "float" kibana want type="number" and format="string"

ref : https://www.elastic.co/guide/en/kibana/current/managing-fields.html#_geographic_point_field_formatters

my poor solution

So, even if I never code in python, I found in mapping.py https://github.com/rfarley3/Kibana/blob/master/kibana/mapping.py#L257

    if key in self.mappings:
                if (key == 'type' and
                    (val == "long" or
                     val == "integer" or
                     val == "double")):
                    val = "number"

I've change it

 if key in self.mappings:
                if (key == 'type' and
                    (val == "long" or
                     val == "float" or
                     val == "integer" or
                     val == "double")):
                    val = "number"

and it's works fine

(even if format still empty and not "sprint" as request)


Question of beginner : Why export config, viz, search and board but not index-pattern ? index-pattern is needed to a correct import.

rfarley3 commented 8 years ago

Thanks for noticing this. It's now fixed in PR #8. Closing this. I'll be making a new pypi release later today with some other small fixes.

Feel free to open a new issue about exporting index-pattern. I don't currently see a need for this, please explain in more detail (in the new issue). Did you know that you can dotkibana --export all --pkg to get everything at once.

Moosh-be commented 8 years ago

Great. I check dotkibana --export all --pkg I would create a new issue to explain my need if dotkibana --export all --pkg doesn't respond to it