Creating Kibana Dashboard Programmatically


(Rajeev) #1

Hi All,

I am trying to create a dashboard pro grammatically.I am using elastic search 2.1.1 ,log stash 2.1.1 and Kibana 4.3.1

Kindly help.


(Tanya Bragin) #2

You can either write directly to the .kibana index or use the URL structure to create dynamic dashboards (though the latter requires you already have saved visualizations you're combining).


(Rajeev) #5

Hi Tbragin,

I tried write directly to the .kibana index using below Curl command and got the error.Can you please help me.

curl -XPUT http://rajeevpc:9200/.kibana/dashboard/testdashboard -d '{[
{
"_id": "D1",
"_type": "dashboard",
"_source": {
"title": "D1",
"hits": 0,
"description": "",
"panelsJSON": "[{"id":"V1","type":"visualization","panelIndex":1,"size_x":3,"size_y":2,"col":1,"row":1}]",
"optionsJSON": "{"darkTheme":false}",
"uiStateJSON": "{}",
"version": 1,
"timeRestore": false,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{"filter":[{"query":{"query_string":{"query":"*","analyze_wildcard":true}}}]}"
}
}
}
]}'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1024 100 469 100 555 14656 17343 --:--:-- --:--:-- --:--:-- 17343{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"json_parse_exception","reason":"Unexpected character ('[' (code 91)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: org.elasticsearch.common.io.stream.InputStreamStreamInput@77224b66; line: 1, column: 3]"}},"status":400}


(system) #6