I have something like a pub/sub system where an entry is added to Elasticsearch every time a subscriber is subscribed to a topic. The SubscriberAdded entry would look something like:
So if 5 subscribers subscribed to the same topic, I would have 5 documents with the same TopicId and each with a different SubscriberId.
The goal with Kibana would be to display a time series where I can see over time the proportion of number of subscribers per topic. So at one point in time I can know for example that I have X topics with 2 subscribers, Y topics with 3 subscribers, Z topics with 3 subscribers and so on...
This seems to me that I need to:
- "group by" the documents by the TopicId to retrieve the count of SubscriberAdded entries for each topic.
- then, "group by" the count I found in #1 so that what is displayed is the different count of subscribers instead of the different topics
- then, do a cumulative sum of #2
From what I can see in the Time Series of Kibana, you can pipeline the aggregations but you cannot do the same with the "Group by". Is there another way to accomplish that?