# Client.search or .get \_source response just shows Object

**URL:** <https://discuss.elastic.co/t/client-search-or-get-source-response-just-shows-object/140950>\
**Category:** Elasticsearch\
**Created:** [July 20, 2018, 5:27pm UTC](https://discuss.elastic.co/t/client-search-or-get-source-response-just-shows-object/140950 "2018-07-20T17:27:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryannelle](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ryannelle](https://discuss.elastic.co/u/ryannelle)\
**Post date:** [July 20, 2018, 5:27pm UTC](https://discuss.elastic.co/t/client-search-or-get-source-response-just-shows-object/140950/1 "2018-07-20T17:27:11Z")

</div>

Running a query from a js file executed by node.js. The query executes correctly but objects like system.auth.program, system.auth.message, don't display correctly and only show up as  
\_source: { system: { auth {: [Object] } } }.

Is this a mapping/nesting?  
All the fields show up in kibana just not when I use a node js client.

My js query:  
var client = require('./connection.js');

client.get({  
index: 'filebeat-6.3.0-2018.07.11',  
\_source: 'system.auth.program',  
type: 'doc',  
id: "bRukiWQBmx8wJj3Gwe5q"  
},function (error, response,status) {  
if (error){  
console.log("search error: "+error)  
}  
else {  
console.log("--- Response ---");  
console.log(response);  
}  
});

What is returned on the console:  
--- Response ---  
{ \_index: 'filebeat-6.3.0-2018.07.11',  
\_type: 'doc',  
\_id: 'bRukiWQBmx8wJj3Gwe5q',  
\_version: 2,  
found: true,  
**\_source: { system: { auth: [Object] } } }**

Would expect to see system.auth.program: sshd returned

---

<div class="post-metadata">

**Author:** ![ryannelle](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ryannelle](https://discuss.elastic.co/u/ryannelle)\
**Post date:** [July 20, 2018, 7:49pm UTC](https://discuss.elastic.co/t/client-search-or-get-source-response-just-shows-object/140950/2 "2018-07-20T19:49:25Z")

</div>

Never mind: Turned out I needed to use client.getSource [getSource](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource)

---

<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 17, 2018, 8:03pm UTC](https://discuss.elastic.co/t/client-search-or-get-source-response-just-shows-object/140950/3 "2018-08-17T20:03:54Z")

</div>

Closed on August 17, 2018, 8:03pm UTC

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