Hi Team,
I am trying to export dashboards, searches and visualizations to kibana using script.
Now that mapping types is removed from indices, how can i push the saved objects.
i am using this below Curl
command:
curl -s -XPUT 'http://localhost:9200/.kibana/doc/System_Navigation' -H "Content-Type: application/json" -d@/visualization/System_Navigation.json
I am saving all the dashboards seperately as JSON files using export api in management tab from kibana. The format they are saved in is not the format that is being accepted while usin above command..it's giving errors for metadat fields _id
_type
"reason":"Field [_id] is a metadata field and cannot be added inside a document. Use the index API request parameters."}
[
{
"_id": "0441cfb0-faa1-11e7-92ec-876f140dfe8f",
"_type": "search",
"_source": {
"title": "Metricbeat Search",
"description": "",
"hits": 0,
"columns": [
"_source"
],
"sort": [
"@timestamp",
"desc"
],
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"index\":\"9d139a80-e696-11e7-8461-6326e2e461fd\",\"highlightAll\":true,\"version\":true,\"query\":{\"language\":\"lucene\",\"query\":\"\"},\"filter\":[]}"
}
}
}
]
my question is how is it possible to export them..do i need to manually format all the exported JSONs (dashboard, visuals, searches and index patterns) like below to match the mapping of .kibana
index like below:
{
"type": "search",
"updated_at": "2018-01-11T09:51:49.685Z",
"search": {
"title": "VMs search",
"description": "",
"hits": 0,
"columns": [
"_source"
],
"sort": [
"@timestamp",
"desc"
],
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": """{"index":"532c80a0-f5e9-11e7-8143-dbeab0fdfcdf","highlightAll":true,"version":true,"query":{"query":"","language":"lucene"},"filter":[{"meta":{"index":"532c80a0-f5e9-11e7-8143-dbeab0fdfcdf","negate":false,"disabled":false,"alias":null,"type":"exists","key":"resource_metadata.state","value":"exists"},"exists":{"field":"resource_metadata.state"},"$state":{"store":"appState"}}]}"""
}
}
}
Please help!!