# How to compare the value of two fields?

**URL:** <https://discuss.elastic.co/t/how-to-compare-the-value-of-two-fields/50551>\
**Category:** Kibana\
**Created:** [May 20, 2016, 11:23am UTC](https://discuss.elastic.co/t/how-to-compare-the-value-of-two-fields/50551 "2016-05-20T11:23:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.francia](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@m.francia](https://discuss.elastic.co/u/m.francia)\
**Post date:** [May 20, 2016, 11:23am UTC](https://discuss.elastic.co/t/how-to-compare-the-value-of-two-fields/50551/1 "2016-05-20T11:23:58Z")

</div>

Hi!

I have two kinds of logs in ES (rtmp and apache), apache has clientip.raw and rtmp has ipclient.raw. The problem is: how can I see in my Kibana panel just the data that has this condition "ipclient=clientip" ?

I tried writing this in my search bar, but doesn´t work:

> ```
> {
> "query": {
> "filtered": {
> "filter": {
> "script": {
> "script": "doc['clientip.raw'].value == doc['ipclient.raw'].value"
> }
> }
> }
> } 
> }
> 
> ```

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:** [July 6, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-compare-the-value-of-two-fields/50551/2 "2017-07-06T13:52:46Z")

</div>


