Is it possible to calculate a value from each document and graph it Visual Builder?

The query below gives me back a series of computed values.
I would like to plot those values in Kibana.
I think I should be able to do this in Visual Builder, but I'm stumped.
There is a calculation aggregation, but it needs an aggregation as input.
I don't have an aggregation, I have a series of documents.

GET /log-lines*/_search
{
"query": {
"bool": {
"must": [
{"match": { "server": "large.pod2.cache2.yyz.cdx-test.example.com" } }
]
}
},
"size" : 0,
"script_fields": {
"lag_seconds" : {
"script" : {
"lang": "painless",
"source" : "int lag = doc['ls-timestamp'].date.millisOfDay - doc['@timestamp'].date.millisOfDay; return ((lag < 0) ? lag + 1000 : lag) / 1000;"
}
}
}
}

I don't believe this is currently possible, sorry!

I had thought the Visual Builder could do anything timelion could do, but clearly not.
Doing the subtraction should be do-able in timelion I think -- though I haven't tried it yet.

I also changed the title to emphasize this is not a "Kibana scripted field" I'm asking about.
I'm asking about computing a value for each record (that is computable from the data in each record).

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