Hi all,
I have exported a visualisation in Kibana, using the export button under settings. This has given me a JSON file. The name of the visualisation is Transaction-count.
I have then deleted the visualisation from Kibana.
I would now like to import the visualisation back into Kibana using the API.
If I type
curl -XPUT "http://localhost:9200/.kibana/visualization/Transaction-count" -d I get the following error;
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}}
If I manually import the visualisation via the web GUI, it works fine.
If I then type;
curl XGET "http://localhost:9200/.kibana/visualization/Transaction-count" it gives me the following JSON;
{"_index":".kibana","_type":"visualization","_id":"Transaction-count","_version":1,"found":true,"_source":{"title":"Transaction count","visState":"{"title":"Transaction count","type":"metric","params":{"handleNoResults":true,"fontSize":"120"},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}}],"listeners":{}}","uiStateJSON":"{}","description":"","savedSearchId":"Transactions","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{"filter":[]}"}}}
If I then type;
curl -XGET "http://localhost:9200/.kibana/visualization/Transaction-count" -d '{"_index":".kibana","_type":"visualization","_id":"Transaction-count","_version":1,"found":true,"_source":{"title":"Transaction count","visState":"{"title":"Transaction count","type":"metric","params":{"handleNoResults":true,"fontSize":"120"},"aggs":[{"id":"1","type":"count","schema":"metric","params":{}}],"listeners":{}}","uiStateJSON":"{}","description":"","savedSearchId":"Transactions","version":1,"kibanaSavedObjectMeta":{"searchSourceJSON":"{"filter":[]}"}}}'
I receive the following output;
{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Field [_index] is a metadata field and cannot be added inside a document. Use the index API request parameters."}],"type":"mapper_parsing_exception","reason":"Field [_index] is a metadata field and cannot be added inside a document. Use the index API request parameters."},"status":400}
Running version 2.3.3 of Elastic and 4.5.1 of Kibana
What am I doing wrong?