# Visualisation: trying to unique count a field with a "-" in it, not working

**URL:** https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072
**Category:** Kibana
**Created:** [October 27, 2015, 11:26am UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072 "2015-10-27T11:26:28Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_Watkins](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mark\_Watkins](https://discuss.elastic.co/u/Mark_Watkins)
#### Post date: [October 27, 2015, 11:26am UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/1 "2015-10-27T11:26:28Z")

</div>

Hi,

I am trying to count unique log streams, and the format of the value is "i-123abc456".  
When I do the unique count, it counts the "i" as one value, so it is adding 1 to my unique count.

i.e. if I had a legend, we would have:  
i  
123abc456

If there were two log streams, "i-123abc456" and "i-789def101", then the count would be three and the legend would be:  
i  
123abc456  
789def101

Do you know what I can do to fix this pls?

Thanks,

---

<div class="post-metadata">

### Author: ![Pieter\_Agenbag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pieter_agenbag/32/4562_2.png) [@Pieter\_Agenbag](https://discuss.elastic.co/u/Pieter_Agenbag)
#### Post date: [October 27, 2015, 12:52pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/2 "2015-10-27T12:52:02Z")

</div>

Its because the field is analysed ... change the field mapping to not\_analyzed or add a not\_analyzed sub field to it that you can reference for this use.

---

<div class="post-metadata">

### Author: ![Mark\_Watkins](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mark\_Watkins](https://discuss.elastic.co/u/Mark_Watkins)
#### Post date: [October 27, 2015, 2:01pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/3 "2015-10-27T14:01:37Z")

</div>

Hi,

I am using the managed version of Elastic + Kibana with AWS. So do you know if it is still possible to do this through that platform?

---

<div class="post-metadata">

### Author: ![Pieter\_Agenbag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pieter_agenbag/32/4562_2.png) [@Pieter\_Agenbag](https://discuss.elastic.co/u/Pieter_Agenbag)
#### Post date: [October 27, 2015, 2:15pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/4 "2015-10-27T14:15:53Z")

</div>

I have no experience with that - but I'm almost 100% sure you should be able to.  
This is a basic and almost always required feature.

How are you loading your data into elasticsearch ?  
You usually put the index mapping through the same REST api that you would use to query elasticsearch directly ...and I'm sure they must expose that to you.

---

<div class="post-metadata">

### Author: ![Mark\_Watkins](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mark\_Watkins](https://discuss.elastic.co/u/Mark_Watkins)
#### Post date: [October 27, 2015, 2:23pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/5 "2015-10-27T14:23:26Z")

</div>

If you have no experience with AWS then my answer to that will be a bit lost. But there is a service within AWS called Cloudwatch. Your application logs get saved there, when new logs are written to this location, a function triggers (lambda) to stream your logs to your elastic search domain.  
There seems to be limited functionality when you set up this 'streaming' - the one option I can see which might help is "Subscription Filter Pattern" - quote: Specify the log event structure and any filter conditions to apply on your log data as it gets streamed to Amazon Elasticsearch Service.  
But not sure how to use that yet.

---

<div class="post-metadata">

### Author: ![Pieter\_Agenbag](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pieter_agenbag/32/4562_2.png) [@Pieter\_Agenbag](https://discuss.elastic.co/u/Pieter_Agenbag)
#### Post date: [October 27, 2015, 2:49pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/6 "2015-10-27T14:49:23Z")

</div>

Yeah - I'm sorry, cant help you there. But you might have better luck asking in the elasticsearch category about how to achieve not\_alayzed field mapping in AWS sollution.

Good luck

---

<div class="post-metadata">

### Author: ![Mark\_Watkins](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Mark\_Watkins](https://discuss.elastic.co/u/Mark_Watkins)
#### Post date: [October 27, 2015, 2:52pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/7 "2015-10-27T14:52:56Z")

</div>

Thanks!

---

<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, 2:10pm UTC](https://discuss.elastic.co/t/visualisation-trying-to-unique-count-a-field-with-a-in-it-not-working/33072/8 "2017-07-06T14:10:34Z")

</div>


