# How to access each value separately in ctx.payload.\_value

**URL:** <https://discuss.elastic.co/t/how-to-access-each-value-separately-in-ctx-payload-value/302450>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [April 14, 2022, 4:10pm UTC](https://discuss.elastic.co/t/how-to-access-each-value-separately-in-ctx-payload-value/302450 "2022-04-14T16:10:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![700grm](https://avatars.discourse-cdn.com/v4/letter/7/3ec8ea/32.png) [@700grm](https://discuss.elastic.co/u/700grm)\
**Post date:** [April 14, 2022, 4:10pm UTC](https://discuss.elastic.co/t/how-to-access-each-value-separately-in-ctx-payload-value/302450/1 "2022-04-14T16:10:01Z")

</div>

Hi, I have two values in payload the host name and IP Address, which I need to access separately:

```auto
      "transform" : {
        "type" : "script",
        "status" : "success",
        "payload" : {
          "_value" : [
            [
              "web01.host.local",
              "10.10.10.10"
            ]
          ]
        }
      },

```

Executing `{{ctx.payload._value}}` concatenates both values `web01.host.local, 10.10.10.10`

I'm looking for something as follow (however it does not work):  
`{{ctx.payload._value.0}}` it should resolve to `web01.host.local`  
`{{ctx.payload._value.1}}` it should resolve to `10.10.10.10`

Thanks in advance

---

<div class="post-metadata">

**Author:** ![700grm](https://avatars.discourse-cdn.com/v4/letter/7/3ec8ea/32.png) [@700grm](https://discuss.elastic.co/u/700grm)\
**Post date:** [April 19, 2022, 11:18am UTC](https://discuss.elastic.co/t/how-to-access-each-value-separately-in-ctx-payload-value/302450/2 "2022-04-19T11:18:52Z")

</div>

The correct answer is `{{ctx.payload._value.0.0}}` and `{{ctx.payload._value.0.1}}` as the array is inside another array

---

<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:** [May 17, 2022, 11:19am UTC](https://discuss.elastic.co/t/how-to-access-each-value-separately-in-ctx-payload-value/302450/3 "2022-05-17T11:19:23Z")

</div>

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