# Kilograms to grams convert processor

**URL:** <https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937>\
**Category:** Elasticsearch\
**Created:** [June 5, 2020, 10:54am UTC](https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937 "2020-06-05T10:54:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitterhh](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gitterhh](https://discuss.elastic.co/u/gitterhh)\
**Post date:** [June 5, 2020, 10:54am UTC](https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937/1 "2020-06-05T10:54:50Z")

</div>

There is a standard processor for bytes [https://www.elastic.co/guide/en/elasticsearch/reference/current/bytes-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/bytes-processor.html)  
Is there similar processor for grams? Or which processor can be used to achieve same functionality?

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [June 5, 2020, 11:57am UTC](https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937/2 "2020-06-05T11:57:54Z")

</div>

The [script processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html) can do many custom operations. Definitely division and multiplication by 1000. Depends on exactly how your data is stored but if you have a field `weight` that has an integer you know is grams, and you want `weight = weight / 1000`, this shouldn't be too hard to do. If it's in the middle of some text description it gets trickier.

---

<div class="post-metadata">

**Author:** ![gitterhh](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gitterhh](https://discuss.elastic.co/u/gitterhh)\
**Post date:** [June 5, 2020, 12:15pm UTC](https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937/3 "2020-06-05T12:15:56Z")

</div>

Yes, we have the `weight` field, and the values can be `3kg`, `1200g`, can you please helpt how this can be implemented using script processor?

---

<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 3, 2020, 12:16pm UTC](https://discuss.elastic.co/t/kilograms-to-grams-convert-processor/235937/4 "2020-07-03T12:16:00Z")

</div>

Closed on July 3, 2020, 12:16pm UTC

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