# How to script to extract the value

**URL:** <https://discuss.elastic.co/t/how-to-script-to-extract-the-value/123362>\
**Category:** Elasticsearch\
**Created:** [March 9, 2018, 11:43pm UTC](https://discuss.elastic.co/t/how-to-script-to-extract-the-value/123362 "2018-03-09T23:43:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticuser1](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@elasticuser1](https://discuss.elastic.co/u/elasticuser1)\
**Post date:** [March 9, 2018, 11:43pm UTC](https://discuss.elastic.co/t/how-to-script-to-extract-the-value/123362/1 "2018-03-09T23:43:44Z")

</div>

Hi, I have following data and I want to extract the value where metadata.items.key equals environment\_\_name.. How can I do that in elastic search and Kibana? thanks

```
          "metadata" : {
            "fingerprint" : "liLJhLhZtnk=",
            "items" : [
              {
                "key" : "sshAccessLdapGroups",
                "value" : "admins"
              },
              {
                "key" : "environment__id",
                "value" : "258a7e32-b32c-4844-96c7-d76b0fd5b009"
              },
              {
                "key" : "environment__name",
                "value" : "zzz00011"
              },
              {
                "key" : "environment__group",
                "value" : "admins"
              },
              {
                "key" : "environment__owner",
                "value" : "admin"
              },
              {
                "key" : "description",
                "value" : ""
              },
              {
                "key" : "task_id",
                "value" : "8003dbbc-26a6-4746-a6cc-e736ee91ea2f"
              }
            ],
            "kind" : "compute#metadata"
          }
```

---

<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:** [April 6, 2018, 11:44pm UTC](https://discuss.elastic.co/t/how-to-script-to-extract-the-value/123362/2 "2018-04-06T23:44:05Z")

</div>

Closed on April 6, 2018, 11:44pm UTC

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