I want to add up a number and show it in a kibana timeline chart.
I've got a datastream which has a connect and disconnect entry. I've written a scripted field in kibana index which adds 1 when its connected to and substracts 1 when it's disconnected. So, I want a timeline chart to show how many connections there are over time by adding up the 1 and -1 e.g. it will be 0, 1, 2, 3, 2, 3, 2, 1, 0 as connections come and go. I can't figure out how toshow this though in a chart. I've looked timelion as well which has the concept of cusum which seems close but can't get that to work either. what I need is some kind of variable that gets stored over calls to the scripted field - but that doesn't look supported.