How can I import an timelion graph?


I have created a graph using a formula.
A timelion script was used and the graph is successfully plotted.
The script looks like:

.es(index='events-*',q='type:counter AND name:n_received_bytes AND tags.path_identifier:1',metric='sum:value').scale_interval(1s).multiply(8).divide(1000)

I save this visualization and export it.
Next step is to import it after a clean installation.
I load the script:

curl -XPUT 'http://elasticsearch.service.consul:9200/.kibana/visualization/VPP_Total_Throughput' -d'{
"title": "VPP_Total_Throughput",
"visState": "{"title":"VPP_Total_Throughput","type":"timelion","params":{"expression":".es(index='events-',q='type:counter AND name:n_received_bytes AND tags.path_identifier:1',metric='sum:value').scale_interval(1s).multiply(8).divide(1000)","interval":"auto"},"aggs":[],"listeners":{}}",
"uiStateJSON": "{}",
"description": "",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{"query":{"query_string":{"query":"

but this does not work.
I get the following error:

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse [visState]"}],"type":"mapper_parsing_exception","reason":"failed to parse [visState]","caused_by":{"type":"json_e_o_f_exception","reason":"Unexpected end-of-input in VALUE_STRING\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@78bc545f; line: 3, column: 308]"}},"status":400}curl: (6) Could not resolve host: AND
curl: (6) Could not resolve host: name
curl: (6) Could not resolve host: AND
curl: (3) [globbing] unmatched close brace/bracket in column 109

I have validated the json-file in several online validators and the json is good.
I have exported/imported other visualizations (not timelion) successfully.

Do you need to do any special trix with escape codes when importing timelion vizualisations?

Br Mathias

Looks like a quoting issue.

Can you put that into a file and try -d @FILENAME instead?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.