# Logstash aggregate doesn't run at all!

**URL:** <https://discuss.elastic.co/t/logstash-aggregate-doesnt-run-at-all/63763>\
**Category:** Logstash\
**Created:** [October 24, 2016, 2:39pm UTC](https://discuss.elastic.co/t/logstash-aggregate-doesnt-run-at-all/63763 "2016-10-24T14:39:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)\
**Post date:** [October 24, 2016, 2:39pm UTC](https://discuss.elastic.co/t/logstash-aggregate-doesnt-run-at-all/63763/1 "2016-10-24T14:39:27Z")

</div>

Down below is my code. I have even set the task\_id to 1, and used add\_tag.  
The ruby code had executed, but aggregate doesn't work.  
Can someone help?

```
if [operation] == "receive a request" {
  ruby {
    code => "
      event['here'] = 'here'

"

```

}  
aggregate {  
task\_id =\> "1"  
code =\> "map['start\_timestamp'] = event['@timestamp']"  
map\_action =\> "create\_or\_update"  
add\_tag =\> ["aggregateStart"]  
}  
}  
if [operation] == "send a answer" {  
ruby {  
code =\> "  
event['there'] = 'there'

```
"

```

}  
aggregate {  
task\_id =\> "1"  
code =\> "event['duration'] = event['@timestamp'] - map['start\_timestamp']"  
map\_action =\> "create\_or\_update"  
end\_of\_task =\> true  
add\_tag =\> ["aggregateEnd"]  
timeout =\> 120  
}  
}

---

<div class="post-metadata">

**Author:** ![fbaligand](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fbaligand/32/5657_2.png) [@fbaligand](https://discuss.elastic.co/u/fbaligand)\
**Post date:** [February 5, 2017, 6:10pm UTC](https://discuss.elastic.co/t/logstash-aggregate-doesnt-run-at-all/63763/2 "2017-02-05T18:10:50Z")

</div>

Which logstash version do you use ?  
Do you see "\_aggregateexception" tag in result event ?  
Do you see errors in logs ?

---

<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:** [July 6, 2017, 4:28am UTC](https://discuss.elastic.co/t/logstash-aggregate-doesnt-run-at-all/63763/3 "2017-07-06T04:28:55Z")

</div>


