# Rest api elasticsearch

**URL:** <https://discuss.elastic.co/t/rest-api-elasticsearch/92254>\
**Category:** Elasticsearch\
**Created:** [July 7, 2017, 11:08am UTC](https://discuss.elastic.co/t/rest-api-elasticsearch/92254 "2017-07-07T11:08:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baha1](https://avatars.discourse-cdn.com/v4/letter/b/b77776/32.png) [@baha1](https://discuss.elastic.co/u/baha1)\
**Post date:** [July 7, 2017, 11:08am UTC](https://discuss.elastic.co/t/rest-api-elasticsearch/92254/1 "2017-07-07T11:08:16Z")

</div>

Hi there,  
I manipulate rest api elasticSearch and i get this result:

```
    {
    took: 48,
    timed_out: false,
       _shards: {
    total: 5,
    successful: 5,
    failed: 0
    },
    hits: {
    total: 111,
    max_score: 1,
    hits: [
    {
    _index: "errors",
    _type: "error",
    _id: "AV0Sd2dn-sq8yPidLBWo",
    _score: 1,
    _source: {
    date: "16:54:46,215",
    path: "c:/logstash.log",
    @timestamp: "2017-07-05T11:16:40.560Z",
    level: "ERROR",
    @version: "1",
    host: "User",
    message: [
    "16:54:46,215 ERROR [stderr] (ServerService Thread Pool -- 42) ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors.",
    "[stderr] (ServerService Thread Pool -- 42) ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors."
    ],
    tags: [
    "groked"
    ]}},]}}

```

My question is how to keep just some specified result like this:

```
 hits: [
        {
        _index: "errors",
        _type: "error",
        _id: "AV0Sd2dn-sq8yPidLBWo",
        _score: 1,
        _source: {
        date: "16:54:46,215",
        path: "c:/logstash.log",
        @timestamp: "2017-07-05T11:16:40.560Z",
        level: "ERROR",
        @version: "1",
        host: "User",
        message: [
        "16:54:46,215 ERROR [stderr] (ServerService Thread Pool -- 42) ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors.",
        "[stderr] (ServerService Thread Pool -- 42) ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. See previously reported errors."
        ]
]}}

```

Any help is greatly appreciate.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 7, 2017, 11:42am UTC](https://discuss.elastic.co/t/rest-api-elasticsearch/92254/2 "2017-07-07T11:42:34Z")

</div>

You can use probably response filtering: [https://www.elastic.co/guide/en/elasticsearch/reference/5.5/common-options.html#common-options-response-filtering](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/common-options.html#common-options-response-filtering)

---

<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:** [August 4, 2017, 11:42am UTC](https://discuss.elastic.co/t/rest-api-elasticsearch/92254/3 "2017-08-04T11:42:55Z")

</div>

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