I have data in JSON Lines format that contains statistics about the tasks performed by a system over an interval of time. (The specific definition of "task" here is not important.)
Each line of JSON Lines contains, among other fields:
- A time stamp representing the start of the time interval
- The total number of tasks in that interval
- The total response time of those tasks
For example, here is a snippet of one of the lines:
{
"Start Interval": "2019-08-31T15:45:00.000Z",
"#Tasks": 6,
"Response Time Total": 2.2305
}
In Kibana (I'm using 7.9.2), I want to chart average response time per task, over time.
Specifically, I want to create a bar chart where the buckets use the Date Histogram aggregation with an auto interval, and the charted value for each bucket is based on the following formula:
Sum("Response Time Total") / Sum("#Tasks")
The Y-axis label would be "Average response time (per task)"; the X-axis label, "@timestamp per [interval]". How do I do this?
I've read some related Elastic documentation topics in this area (for example, "Pipeline aggregations"), but the solution is still not clear to me.
I think the solution involves defining, in the visualization metrics:
- Y-axis Sum of #Tasks
- Y-axis Sum of Response Time Total
- Y-axis... here, I'm not sure... some metric that specifies, under Advanced > JSON input, some JSON that refers to the above two metrics in a "script" formula
(I've already done this, using the same JSON Lines data, in a different analytics platform. Rhymes with "slam dunk" . Now I need to reproduce that visualization in Kibana.)