Auth logs not shown under nodejs?

Hello,

We have this:

client.jsonApiCall('GET', '/admin/v2/logs/authentication', { mintime: '1637616411572', maxtime: '1637702811573', users: '■■■■■■■■■■■■■■■■■■■■' }, console.log);

which returns:

{
  response: {
    authlogs: [ [Object], [Object], [Object] ],
    metadata: { next_offset: [Array], total_objects: 3 }
  },
  stat: 'OK'
}

How do I get to see the contents of those “Object” fields?

Thanks.

Try using util.inspect with both maxArrayLength: null, depth: null. My output went from:

{
  authlogs: [
    {
      access_device: [Object],
      alias: '',
      application: [Object],
      auth_device: [Object],
      email: '',
      event_type: 'authentication',
      factor: 'duo_push',
      isotimestamp: '2021-11-15T17:53:15.175050+00:00',
      ood_software: null,
      reason: 'user_mistake',
      result: 'denied',
      timestamp: 1636998795,
      trusted_endpoint_status: 'not trusted',
      txid: '9e3319e3-7876-nnnn-a485-a5f1afd9ed06',
      user: [Object]
    }
  ],
  metadata: {
    next_offset: [ '1636998795175', '9e3319e3-7876-nnnn-a485-a5f1afd9ed06' ],
    total_objects: 1
  }
}

to

{
  authlogs: [
    {
      access_device: {
        browser: 'Chrome',
        browser_version: '95.0.4638.69',
        epkey: 'EPblahblah',
        flash_version: 'uninstalled',
        hostname: null,
        ip: '136.n.n.n',
        is_encryption_enabled: 'unknown',
        is_firewall_enabled: 'unknown',
        is_password_set: 'unknown',
        java_version: 'uninstalled',
        location: { city: 'Austin', country: 'United States', state: 'Texas' },
        os: 'Linux',
        os_version: '',
        security_agents: 'unknown'
      },
      alias: '',
      application: { key: 'DIblahblah', name: 'Web SDK 145' },
      auth_device: {
        ip: '136.n.n.n',
        location: { city: 'Austin', country: 'United States', state: 'Texas' },
        name: 'Motorola Moto G Power'
      },
      email: '',
      event_type: 'authentication',
      factor: 'duo_push',
      isotimestamp: '2021-11-15T17:53:15.175050+00:00',
      ood_software: null,
      reason: 'user_mistake',
      result: 'denied',
      timestamp: 1636998795,
      trusted_endpoint_status: 'not trusted',
      txid: '9e3319e3-7876-nnnn-a485-a5f1afd9ed06',
      user: { groups: [], key: 'DUblahblah', name: 'someuser' }
    }
  ],
  metadata: {
    next_offset: [ '1636998795175', '9e3319e3-7876-nnnn-a485-a5f1afd9ed06' ],
    total_objects: 1
  }
}

I guess I no longer can claim “zero node experience”. :slight_smile:

FWIW I have just been riffing off the demo duo_admin.js script, and I changed the console output lines to:

        res = res.response;
        const util = require('util')
        console.log(util.inspect(res, { maxArrayLength: null, depth: null }));

Perfect, thanks a lot :slight_smile: