How to upload a visualtion data to kibana using curl command or using the requests post


(Ranganatha) #1

i want to upload a json visualizations data to kibana using the curl command and this json data was obtained from the kibana itself
is there a way that i could create the visualizations from the python script itself by using the json data from the kibana visualizations.
i am trying to create a new visualizations for users by making little changes in the json visual data,,,is this possible??

here is the json data that i am trying to upload:

{
"title":"cpu_2",
"visState":""" {"params": {"addTimeMarker": false, "grid": {"style": {"color": "#eee"}, "categoryLines": false}, "seriesParams": [{"showCircles": true, "show": true, "type": "histogram", "mode": "stacked", "drawLinesBetweenPoints": true, "valueAxis": "ValueAxis-1", "data": {"id": "2", "label": "Max Cpu_utilisation"}}], "legendPosition": "right", "addTooltip": true, "times": , "categoryAxes": [{"style": {}, "scale": {"type": "linear"}, "title": {}, "show": true, "position": "bottom", "labels": {"truncate": 100, "show": true}, "type": "category", "id": "CategoryAxis-1"}], "type": "histogram", "valueAxes": [{"style": {}, "scale": {"type": "linear", "mode": "normal"}, "title": {"text": "Max Cpu_utilisation"}, "name": "LeftAxis-1", "show": true, "position": "left", "labels": {"filter": false, "rotate": 0, "truncate": 100, "show": true}, "type": "value", "id": "ValueAxis-1"}], "addLegend": true}, "type": "histogram", "aggs": [{"type": "max", "enabled": true, "id": "2", "params": {"field": "Cpu_utilisation"}, "schema": "metric"}, {"type": "terms", "enabled": true, "id": "3", "params": {"orderBy": "2", "field": "Time.keyword", "otherBucketLabel": "Other", "otherBucket": false, "missingBucket": false, "order": "desc", "missingBucketLabel": "Missing", "size": 20}, "schema": "segment"}], "title": "cpu_2"}""",
"uiStateJSON":"{}",
"description" : "",
"version" : 1,
"kibanaSavedObjectMeta":{"searchSourceJSON":""""{"index": "220222b0-06ea-11e9-9ee2-1d0446b8a21a","query": {"language": "lucene","query": ""},"filter": }"""}
}

this is json output of a visualization created in kibana .