# Boolean filters not working as expected

**URL:** <https://discuss.elastic.co/t/boolean-filters-not-working-as-expected/124314>\
**Category:** Kibana\
**Created:** [March 16, 2018, 2:10pm UTC](https://discuss.elastic.co/t/boolean-filters-not-working-as-expected/124314 "2018-03-16T14:10:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![panaman](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@panaman](https://discuss.elastic.co/u/panaman)\
**Post date:** [March 16, 2018, 2:10pm UTC](https://discuss.elastic.co/t/boolean-filters-not-working-as-expected/124314/1 "2018-03-16T14:10:06Z")

</div>

I am getting this message on the top of kibana when I filter on a boolean value  
"Discover: Boolean scripted fields must return true or false"

I have deleted all the data and only have two documents in the index.  
I have logstash add a value of true or false to a field called "[proxied][connection]"

My mapping is correct also  
"proxied": {  
"properties": {  
"as\_org": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"asn": {  
"type": "long"  
},  
"connection": {  
"type": "boolean"  
},

I even added a convert in logstash to see if it would fix it and it still gives me the error in kibana when i try and use that filter  
mutate {  
add\_field =\> {  
"[proxied][connection]" =\> "true"  
}  
convert =\> { "[proxied][connection]" =\> "boolean" }  
}

I am pounding my head trying to figure this out, anyhelp would be appreciated.

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [March 16, 2018, 5:45pm UTC](https://discuss.elastic.co/t/boolean-filters-not-working-as-expected/124314/2 "2018-03-16T17:45:04Z")

</div>

Are you trying to create a filter on "connection"? Or on your scripted field? What does your scripted field definition look like?

---

<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:** [April 13, 2018, 5:45pm UTC](https://discuss.elastic.co/t/boolean-filters-not-working-as-expected/124314/3 "2018-04-13T17:45:04Z")

</div>

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