# Dsl querries

**URL:** <https://discuss.elastic.co/t/dsl-querries/265587>\
**Category:** Kibana\
**Tags:** kql-kibana-query-language\
**Created:** [February 26, 2021, 9:36am UTC](https://discuss.elastic.co/t/dsl-querries/265587 "2021-02-26T09:36:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 26, 2021, 9:36am UTC](https://discuss.elastic.co/t/dsl-querries/265587/1 "2021-02-26T09:36:03Z")

</div>

Hi, how can i GET those two fields with DSL queries? ![javastate](https://us1.discourse-cdn.com/elastic/original/3X/7/a/7a01232b90fb796825ade48f33bf44fc5b429618.png)

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 26, 2021, 9:37am UTC](https://discuss.elastic.co/t/dsl-querries/265587/2 "2021-02-26T09:37:35Z")

</div>

i tried these commands but i'm not sure of the results  
GET metricbeat-7.11.1-2021.02.19-000001/\_search  
{  
"\_source": ["process.name","process.state"]  
}  
 ![res](https://us1.discourse-cdn.com/elastic/original/3X/4/8/4828595f02f85d36c9835c26ce57b77d7f65e391.png)

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [February 26, 2021, 3:34pm UTC](https://discuss.elastic.co/t/dsl-querries/265587/3 "2021-02-26T15:34:43Z")

</div>

@NourBM The query DSL you provided works fine for me. Here's the test case I'm using:

```auto
POST test/_doc
{
  "process": {
    "name": "java",
    "state": "sleeping"
  }
}

POST test/_search
{
  "_source": ["process.name", "process.state"]
}

```

Are you certain those fields have values for all of the documents you are getting back? If those fields are missing in any docs, that would be why you aren't seeing anything in `_source`.

You can test this by filtering out any docs that don't have a value for those fields:

```auto
POST test/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "exists": { "field": "process.name" }
        },
        {
          "exists": { "field": "process.state" }
        }
      ]
    }
  },
  "_source": ["process.name", "process.state"]
}

```

---

<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 26, 2021, 3:34pm UTC](https://discuss.elastic.co/t/dsl-querries/265587/4 "2021-03-26T15:34:50Z")

</div>

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