When I create a saved_object (dashboard) using the API, the 4 time attributes (timeRestore, timeTo, timeFrom, refreshInterval) are not created. But if I import the exact same object using the Saved Objects page of the Kibana UI, they are created. Here is the dashboard object:
[ { "_id": "metricbeat-system-host-overview", "_type": "dashboard", "_source": { "title": "[Metricbeat System] Host overview", "hits": 0, "description": "Overview of host metrics", "panelsJSON": "[<omitted>]", "optionsJSON": "{\"darkTheme\":false}", "version": 1, "timeRestore": true, "timeTo": "now", "timeFrom": "now-15m", "refreshInterval": { "pause": false, "value": 10000 }, "kibanaSavedObjectMeta": { "searchSourceJSON": "{\"filter\":[],\"query\":{\"query\":\"\",\"language\":\"lucene\"},\"version\":true,\"highlightAll\":true}" } }, "_migrationVersion": { "dashboard": "7.0.0" }, "_references": [<omitted>] } ]
Here is the API curl command, which is issued through shellExec() in my app:
curl -f -k -X POST -H 'kbn-xsrf:true' -H 'Content-type:application/json' -d '{ "attributes": ${JSON.stringify(item._source)}, "references": ${JSON.stringify(item._references)} }' "${KIBANA_ADDRESS}/api/saved_objects/${item._type}/${item._id}?overwrite=true"
Everything is created nicely except nothing for those 4 time attributes. Am I doing something wrong, or is this a Kibana bug?
I am using the grafana/grafana docker (and the elasticsearch docker) v7.1.0.