# Getting static lookup value with id

**URL:** <https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874>\
**Category:** Kibana\
**Tags:** runtime-fields\
**Created:** [February 22, 2022, 10:43am UTC](https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874 "2022-02-22T10:43:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bytesnow](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@bytesnow](https://discuss.elastic.co/u/bytesnow)\
**Post date:** [February 22, 2022, 10:43am UTC](https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874/1 "2022-02-22T10:43:11Z")

</div>

Hi,  
I am trying to get some data from elastic, I have added a static look up for customerId (123 -\> abc ....)in kibana, i am using the below query to get the data but it returns the id and not the look up data, is there a way i can get the customerId and the lookup data that i have added as well,  
i am using below query in go to get the data.

```auto
GET _search
{
  "aggs": {
    "rec": {
      "terms": {
        "field": "customerId.keyword",
        "order": {
          "_count": "desc"
        },
        "size": 15
      }
    }
  },
  "size": 0,
  
  "script_fields": {},
  "stored_fields": [
    "*"
  ],
  "runtime_mappings": {},
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_all": {}
        },
        {
          "match_phrase": {
            "status": "Active"
          }
        },
        {
          "range": {
            "dateTime": {
              "gte": "2022-02-14T09:33:16.630Z",
              "lte": "2022-02-14T09:48:16.630Z",
              "format": "strict_date_optional_time"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

```

Thanks in advance for your time

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [February 23, 2022, 9:26am UTC](https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874/2 "2022-02-23T09:26:48Z")

</div>

Hi there,  
unfortunately, static lookup is a Kibana formatter so it cannot be accessed when hitting Elasticsearch directly.

---

<div class="post-metadata">

**Author:** ![bytesnow](https://avatars.discourse-cdn.com/v4/letter/b/7ab992/32.png) [@bytesnow](https://discuss.elastic.co/u/bytesnow)\
**Post date:** [February 23, 2022, 9:35am UTC](https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874/3 "2022-02-23T09:35:58Z")

</div>

Hi,  
ok thank you, any api or query that can help me get the static lookup from kibana ?

---

<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:** [March 23, 2022, 9:36am UTC](https://discuss.elastic.co/t/getting-static-lookup-value-with-id/297874/4 "2022-03-23T09:36:31Z")

</div>

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