# Showing an aggregation in Kibana dashboard?

**URL:** <https://discuss.elastic.co/t/showing-an-aggregation-in-kibana-dashboard/20759>\
**Category:** Elasticsearch\
**Created:** [November 14, 2014, 9:17pm UTC](https://discuss.elastic.co/t/showing-an-aggregation-in-kibana-dashboard/20759 "2014-11-14T21:17:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticSearch\_Users\_](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@ElasticSearch\_Users\_](https://discuss.elastic.co/u/ElasticSearch_Users_)\
**Post date:** [November 14, 2014, 9:17pm UTC](https://discuss.elastic.co/t/showing-an-aggregation-in-kibana-dashboard/20759/1 "2014-11-14T21:17:38Z")

</div>

Hi, I'm trying to build an aggregation and show the number in Kibana I have  
the agg working in sense, but when I try to move it to my .js dashboard, I  
can't get it to publish the aggregation (in this case an expected value of  
"2". I guess overall my question is how do I integrate an aggregation into  
a .js dashboard. Does the agg belong in the services: queries part of the  
dashboard or elsewhere? Details below.

###################################  
Here is the aggs in sense:

GET /events/\_search?search\_type=count  
{  
"aggs": {  
"machine\_devices": {  
"cardinality": {  
"field": "logsource"  
}  
}  
}  
}

and it properly returns :

"took": 7,  
...omitted for brevity  
},  
"aggregations": {  
"machine\_devices": {  
"value": 2  
}

####################################  
And here is the dashboard.js script

"8": {

```
 "id": 8,

 "enable": true,

 "aggs": {

   "machine_devices" : {

     "cardinality" :

       { "field": "logsource" }

   }

 }

```

}

...omitted for brevity

{

```
title: 'Devices',

field: 'machine_devices',

type: 'terms',

chart: 'table',

order: 'term',

counter_pos: 'none',

missing: false,

other: false,

size: '10',

editable: _editable,

spyable: _spyable,

time_field: ARGS.timefield||"@timestamp",

queries: {

  'mode': 'selected',

  ids: [8]

},

span: 2

```

}

Thanks for your help. ES rocks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a4b34a10-e114-45fe-aad3-7bea06b58d7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a4b34a10-e114-45fe-aad3-7bea06b58d7e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:49am UTC](https://discuss.elastic.co/t/showing-an-aggregation-in-kibana-dashboard/20759/2 "2017-07-06T00:49:53Z")

</div>

Closed on July 6, 2017, 12:49am UTC


