Trying to load new dashboard after pushing it to ES using curl


(Revanth Alampally) #1

Hi
I saved a dashboard in Kibana and I can see that in Elastic search when I do:
curl -XGET http://localhost:9200/kibana-int/dashboard/_search?pretty

Now I exported this dashboard to a json file and pushed the dashboard to ES.
I am doing this using:
curl -X PUT http://localhost:9200/kibana-int/dashboard/dashboard-name -T exported.json
This is successful and I also see this new dashboard when I do a GET like previously.
I can also see it in the list of dashboards to load from in Kibana BUT when I load it, kibana webpage is empty! I checked the REST responses and both of them are exactly the same.
Does anyone have an idea?

Thanks,
Revanth


(Lee Drengenberg) #2

Hi Revanth,

If you do your dashboard search again does the one you added look the same as the original (other than the name)?

Correction, you need to remove several of the fields so you only have what is in the _source element to PUT it. I was able to PUT this and it worked;

{
    "title": "Dashboard Test 3",
    "hits": 0,
    "description": "",
    "panelsJSON": "[{\"id\":\"Visualization漢字-AreaChart\",\"type\":\"visualization\",\"panelIndex\":1,\"size_x\":3,\"size_y\":2,\"col\":1,\"row\":1},{\"id\":\"Visualization☺漢字-DataTable\",\"type\":\"visualization\",\"panelIndex\":2,\"size_x\":3,\"size_y\":2,\"col\":4,\"row\":1},{\"id\":\"Visualization漢字-LineChart\",\"type\":\"visualization\",\"panelIndex\":3,\"size_x\":3,\"size_y\":2,\"col\":7,\"row\":1},{\"id\":\"Visualization-PieChart\",\"type\":\"visualization\",\"panelIndex\":4,\"size_x\":3,\"size_y\":2,\"col\":10,\"row\":1},{\"id\":\"Visualization-TileMap\",\"type\":\"visualization\",\"panelIndex\":5,\"size_x\":3,\"size_y\":2,\"col\":1,\"row\":3},{\"id\":\"Visualization☺-VerticalBarChart\",\"type\":\"visualization\",\"panelIndex\":6,\"size_x\":3,\"size_y\":2,\"col\":4,\"row\":3},{\"id\":\"Visualization-MetricChart\",\"type\":\"visualization\",\"panelIndex\":7,\"size_x\":3,\"size_y\":2,\"col\":7,\"row\":3}]",
    "optionsJSON": "{\"darkTheme\":false}",
    "uiStateJSON": "{\"P-2\":{\"vis\":{\"params\":{\"sort\":{\"columnIndex\":null,\"direction\":null}}}},\"P-5\":{\"mapCenter\":[14.944784875088372,4.74609375]}}",
    "version": 1,
    "timeRestore": false,
    "kibanaSavedObjectMeta": {
      "searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
      }
}'

Also, some of the functional test automation for Kibana is now using elasticdump to save and load data. You might want to check it out.

Thanks,
Lee


(system) #3