# Jmx plugin and aggregate

**URL:** https://discuss.elastic.co/t/jmx-plugin-and-aggregate/162083
**Category:** Logstash
**Created:** [December 25, 2018, 8:05pm UTC](https://discuss.elastic.co/t/jmx-plugin-and-aggregate/162083 "2018-12-25T20:05:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ncasaux](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ncasaux/32/46950_2.png) [@ncasaux](https://discuss.elastic.co/u/ncasaux)
#### Post date: [December 25, 2018, 8:05pm UTC](https://discuss.elastic.co/t/jmx-plugin-and-aggregate/162083/1 "2018-12-25T20:05:45Z")

</div>

Hello,

I try to aggregate some events coming from the jmx plugin, but I never managed to aggregate anything. As if that was not possible...

Here the code I have so far:

```
filter {
  grok {
    match => { "metric_path" => "(?<alias>[^\.]*)\.(?<jmx_path>.*)\.(?<jmx_attribute>[^\.]*)" }
    add_field => {
      "%{jmx_attribute}" => "%{metric_value_number}"
    }
  }
  aggregate {
    task_id => "%{jmx_path}"
    code => "event.set('dummyKey', 'dummyValue')"
    inactivity_timeout => 10
 }
}

```

In ElasticSearch, I can see the `dummyKey` field, so my aggregation code is actually executed.  
However, nothing is aggregated at all. If I have 10 input events, then I got 10 output event, all of them with the `dummyKey` field populated.

Is this type of aggregation possible with this plugin ? Am I missing something ? Any chance to have a working sample ?

Thanks in advance.

---

<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: [January 22, 2019, 8:05pm UTC](https://discuss.elastic.co/t/jmx-plugin-and-aggregate/162083/2 "2019-01-22T20:05:46Z")

</div>

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