# Logstash metric not displaying %{count} in the output

**URL:** <https://discuss.elastic.co/t/logstash-metric-not-displaying-count-in-the-output/72347>\
**Category:** Logstash\
**Created:** [January 20, 2017, 9:36pm UTC](https://discuss.elastic.co/t/logstash-metric-not-displaying-count-in-the-output/72347 "2017-01-20T21:36:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![irom77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irom77/32/12976_2.png) [@irom77](https://discuss.elastic.co/u/irom77)\
**Post date:** [January 20, 2017, 9:36pm UTC](https://discuss.elastic.co/t/logstash-metric-not-displaying-count-in-the-output/72347/1 "2017-01-20T21:36:40Z")

</div>

I have metrics adding 'Counted" tag and sending email when count is greater than 1. All is fine except I receive THREAT count: %{count} 0.20536684761303686 in subject instead of THREAT count: 2 0.20536684761303686

> if "Counted" in [tags] {  
> if [THREAT][count] \> 1 {  
> stdout { codec =\> rubydebug }  
> email {  
> from =\> "[logstash@com.com](mailto:logstash@com.com)"  
> subject =\> "THREAT count: %{count} %{[THREAT][rate\_1m]} "  
> to =\> "[iromaniuk@com.com](mailto:iromaniuk@com.com)"  
> via =\> "smtp"  
> address =\> "10.10.10.1"
> 
> ```
> }
> }
> }
> 
> ```

I can see "count" in the output correctly, please advice

> {  
> "@timestamp" =\> 2017-01-20T21:28:57.895Z,  
> "@version" =\> "1",  
> "message" =\> "88c14f00ec99",  
> "THREAT" =\> {  
> "rate\_1m" =\> 0.20536684761303686,  
> "rate\_15m" =\> 0.3826114956412116,  
> "count" =\> 2,  
> "rate\_5m" =\> 0.35006932761717907  
> },  
> "tags" =\> [  
> [0] "Counted"  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![irom77](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irom77/32/12976_2.png) [@irom77](https://discuss.elastic.co/u/irom77)\
**Post date:** [January 20, 2017, 11:18pm UTC](https://discuss.elastic.co/t/logstash-metric-not-displaying-count-in-the-output/72347/2 "2017-01-20T23:18:00Z")

</div>

> [@irom77](#):
>
> %{count}

I found it , should be %{[THREAT][count]

---

<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:** [February 17, 2017, 11:18pm UTC](https://discuss.elastic.co/t/logstash-metric-not-displaying-count-in-the-output/72347/3 "2017-02-17T23:18:41Z")

</div>

Closed on February 17, 2017, 11:18pm UTC

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