# Transform usage - How to push event for all specific terms even if one of them is missing

**URL:** <https://discuss.elastic.co/t/transform-usage-how-to-push-event-for-all-specific-terms-even-if-one-of-them-is-missing/271326>\
**Category:** Logstash\
**Created:** [April 27, 2021, 7:20am UTC](https://discuss.elastic.co/t/transform-usage-how-to-push-event-for-all-specific-terms-even-if-one-of-them-is-missing/271326 "2021-04-27T07:20:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigneshr35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshr35/32/32636_2.png) [@vigneshr35](https://discuss.elastic.co/u/vigneshr35)\
**Post date:** [April 27, 2021, 7:20am UTC](https://discuss.elastic.co/t/transform-usage-how-to-push-event-for-all-specific-terms-even-if-one-of-them-is-missing/271326/1 "2021-04-27T07:20:50Z")

</div>

Hi Team,

I have a scenario. I have a transform created that groups all events of each day from the source index into 3 different status - Completed, Terminated and Retry. For example, if for 25th Apr 2021 we have Completed - 3, Terminated - 5 and Retry - 1, then destination index has 3 records for 25th Apr as shown below.

```
{"keyword": "Completed","Count": 3, "Per day": "2021-04-25T00:00:00.000Z"}
{"keyword": "Terminated","Count": 5, "Per day": "2021-04-25T00:00:00.000Z"}
{"keyword": "Retry","Count": 1, "Per day": "2021-04-25T00:00:00.000Z"}

```

This is all working as expected. Now, if there is no Retry events for 26th Apr, transform has following in destination index which is again as expected.

```
{"keyword": "Completed","Count": 3, "Per day": "2021-04-26T00:00:00.000Z"}
{"keyword": "Terminated","Count": 5, "Per day": "2021-04-26T00:00:00.000Z"}

```

But the problem is I need to push the data from destination index to another output(Kafka, in my case) for all the 3 cases, including one for the missing Retry. So, effectively I want to push to Kafka 3 events as shown below(including one for Retry with count as 0) instead of 2

```
{"keyword": "Completed","Count": 3, "Per day": "2021-04-26T00:00:00.000Z"}
{"keyword": "Terminated","Count": 5, "Per day": "2021-04-26T00:00:00.000Z"}
{"keyword": "Retry","Count": 0, "Per day": "2021-04-26T00:00:00.000Z"}

```

Not sure how this can be achieved. Any suggestions/inputs here will be very helpful.

Thank you,  
Vignesh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 25, 2021, 7:21am UTC](https://discuss.elastic.co/t/transform-usage-how-to-push-event-for-all-specific-terms-even-if-one-of-them-is-missing/271326/2 "2021-05-25T07:21:00Z")

</div>

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