# Get the result of split two values into alert or another value

**URL:** <https://discuss.elastic.co/t/get-the-result-of-split-two-values-into-alert-or-another-value/351645>\
**Category:** Kibana\
**Created:** [January 23, 2024, 4:07pm UTC](https://discuss.elastic.co/t/get-the-result-of-split-two-values-into-alert-or-another-value/351645 "2024-01-23T16:07:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cperzrt10](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cperzrt10/32/116152_2.png) [@cperzrt10](https://discuss.elastic.co/u/cperzrt10)\
**Post date:** [January 23, 2024, 4:07pm UTC](https://discuss.elastic.co/t/get-the-result-of-split-two-values-into-alert-or-another-value/351645/1 "2024-01-23T16:07:46Z")

</div>

I have data with 2 variables, one is the total number of http response code and another is only the total of http response code with the value of "200".

the structure is the result of transform the result is like this

```auto
"hits": [
      {
        "_index": "transformation_1",
        "_id": "TY8VM6b388qsv-n3X6st77IAAAAAAAAA",
        "_score": 1,
        "_source": {
          "agent": "Madrid",
          "@timestamp": {
            "max": "2024-01-23T10:50:30.633Z"
          },
          "httpResponseCode200": 547941,
          "httpResponseCodeTotal": 550235
        }
      },.....

```

I want to calculate de httpResponseCode200/httpResponseCodeTotal of into enrich processor to create another variable.

How can I do it?

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [February 1, 2024, 12:01pm UTC](https://discuss.elastic.co/t/get-the-result-of-split-two-values-into-alert-or-another-value/351645/2 "2024-02-01T12:01:13Z")

</div>

You can create an [ingest pipeline](https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html) that computes that value on any new record written to the transform index using a [script processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html).

The transforms UI allows you to set up a pipeline so you can probably create it and set it up.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/e/be588209275af89b7aed6144f3066cd7d10a9c52.png)

---

<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:** [February 29, 2024, 12:01pm UTC](https://discuss.elastic.co/t/get-the-result-of-split-two-values-into-alert-or-another-value/351645/3 "2024-02-29T12:01:14Z")

</div>

Closed on February 29, 2024, 12:01pm UTC

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