On my old dev stack I used the beats setup feature to install the example dashboards. That ended up with a bunch I will never use. So now that I'm building an actual test stack, I want to pick and choose which dashboards I import.
I started with this on: https://github.com/elastic/beats/blob/v7.6.2/metricbeat/module/system/_meta/kibana/7/dashboard/Metricbeat-host-overview.json
I found the docs on how to import and tried it out.
The response:
{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"}
In Kibana's logs:
testelk01_kibana | {"type":"error","@timestamp":"2020-04-29T11:17:53-07:00","tags":[],"pid":6,"level":"error","error":{"message":"Failure attempting to migrate saved object 'Network Traffic (Packets) [Metricbeat System] ECS' - SyntaxError: Unexpected token o in JSON at position 1","name":"Error","stack":"Error: Failure attempting to migrate saved object 'Network Traffic (Packets) [Metricbeat System] ECS' - SyntaxError: Unexpected token o in JSON at position 1\n at 7.0.0 (/usr/share/kibana/src/legacy/core_plugins/kibana/migrations/migrations.js:605:15)\n at tryTransformDoc (/usr/share/kibana/src/core/server/saved_objects/migrations/core/document_migrator.js:213:22)\n at migrateProp (/usr/share/kibana/src/core/server/saved_objects/migrations/core/document_migrator.js:270:11)\n at applyMigrations (/usr/share/kibana/src/core/server/saved_objects/migrations/core/document_migrator.js:172:11)\n at DocumentMigrator.transformAndValidate [as transformDoc] (/usr/share/kibana/src/core/server/saved_objects/migrations/core/document_migrator.js:151:43)\n at DocumentMigrator.doc [as migrate] (/usr/share/kibana/src/core/server/saved_objects/migrations/core/document_migrator.js:47:19)\n at KibanaMigrator.migrateDocument (/usr/share/kibana/src/core/server/saved_objects/migrations/kibana/kibana_migrator.js:139:34)\n at objects.map.object (/usr/share/kibana/src/core/server/saved_objects/service/lib/repository.js:233:74)\n at Array.map (<anonymous>)\n at SavedObjectsRepository.bulkCreate (/usr/share/kibana/src/core/server/saved_objects/service/lib/repository.js:217:37)\n at SavedObjectsClient.bulkCreate (/usr/share/kibana/src/core/server/saved_objects/service/saved_objects_client.js:46:35)\n at EncryptedSavedObjectsClientWrapper.bulkCreate (/usr/share/kibana/x-pack/plugins/encrypted_saved_objects/server/saved_objects/encrypted_saved_objects_client_wrapper.js:80:89)\n at process._tickCallback (internal/process/next_tick.js:68:7)"},"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":{},"pathname":"/api/kibana/dashboards/import","path":"/api/kibana/dashboards/import","href":"/api/kibana/dashboards/import"},"message":"Failure attempting to migrate saved object 'Network Traffic (Packets) [Metricbeat System] ECS' - SyntaxError: Unexpected token o in JSON at position 1"}
Since I didn't anything like it in the documentation example, I removed this from the end of the dashboard json:
,
"version": "6.0.0-rc1-SNAPSHOT"
Still ended up with the same error.
My curl command, ran on the same server as Kibana. Removed the dashboard json due to Discourse character limits.
curl -X POST "http://adminusername:password@localhost:5601/api/kibana/dashboards/import" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
< json of the dashboard, modified as I mentioned above >
'
What am I missing?
Is there a UI option for importing that I just haven't found?
Thanks.