# Math operation on Kibana lucene query

**URL:** <https://discuss.elastic.co/t/math-operation-on-kibana-lucene-query/275930>\
**Category:** Kibana\
**Created:** [June 15, 2021, 4:56am UTC](https://discuss.elastic.co/t/math-operation-on-kibana-lucene-query/275930 "2021-06-15T04:56:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![niraj\_pandey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_pandey/32/44034_2.png) [@niraj\_pandey](https://discuss.elastic.co/u/niraj_pandey)\
**Post date:** [June 15, 2021, 4:56am UTC](https://discuss.elastic.co/t/math-operation-on-kibana-lucene-query/275930/1 "2021-06-15T04:56:27Z")

</div>

Hi,

Just want to know can we perform math operation with lucene query in kibana. I have a variable and it's value is in GB. I want to convert it in KB in lucene query something like this.

$mem = 4

Kibana lucene query like:

usemem:\>($mem \* 1024 \* 1024)

Thanks  
Niraj

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 15, 2021, 5:02am UTC](https://discuss.elastic.co/t/math-operation-on-kibana-lucene-query/275930/2 "2021-06-15T05:02:14Z")

</div>

No you cannot.

You can with a scripted field though.

---

<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 13, 2021, 5:02am UTC](https://discuss.elastic.co/t/math-operation-on-kibana-lucene-query/275930/3 "2021-07-13T05:02:33Z")

</div>

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