I have a visualization created in Kibana and I wanted to know if I can take the request that kibana sends to elastic search and run that request manually? Currently when I do that, elasticsearch throws exceptions. I would like to basically have a way to get a csv version of this visualization. I was assuming that there were two ways about this; one would be to run the request directly to elastic search to fetch the data, or, two, if there was a kibana api which I can call that exports the csv of this already created visualization.
Here is the request that causes elastic search to throw exceptions:
{
"query": {
"bool": {
"must": [
{
"query_string": {
"analyze_wildcard": true,
"query": "*"
}
},
{
"range": {
"@timestamp": {
"gte": 1509681600000,
"lte": 1509767999999,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"size": 0,
"_source": {
"excludes": []
},
"aggs": {
"3": {
"terms": {
"script": {
"inline": "return doc['srcAS.asn'].value + '-' + doc['dstAS.asn'].value",
"lang": "painless"
},
"size": 10,
"order": {
"2": "desc"
},
"valueType": "string"
},
"aggs": {
"2": {
"sum": {
"field": "PacketSize",
"script": "doc['PacketSize'].value * doc['SampleRate'].value * 0.000000000001"
}
}
}
}
}
}