Client.search or .get _source response just shows Object


(Ryan Nelle) #1

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


(Ryan Nelle) #2

Never mind: Turned out I needed to use client.getSource getSource


(system) #3

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