Hi everyone,
I'm writing this kind of data into elastic:
{'action': 'customer.created', 'user': 'john', '@timestamp': datetime.datetime(2019, 2, 25, 12, 43, 11, 691604)}
{'action': 'customer.deleted', 'user': 'john', '@timestamp': datetime.datetime(2019, 2, 25, 12, 44, 11, 691604)}
What I would like to do is to show the total amount of customer.created - customer.deleted so I know the net amount. The solution should work with the time scale (so if I view data over last year, I should see the total amount of customers for that year, if last week then the amount for last week, and so on)
I haven't been able to figure out how to do this, do I need scripted fields? InputJSON? Any pointers in the right correction would be welcome.
Bonus round: is there a way to sum all the data up unto the timeframe I'm viewing so I can get a real reflection of total number of customers at a certain time frame also?
Thanks for the help!
