def _osquery(sql, format='json'):
    ret = {
        'result': True,
    }

    cmd = 'osqueryi --json "{0}"'.format(sql)
    res = __salt__['cmd.run_all'](cmd)
    if res['retcode'] == 0:
        ret['data'] = json.loads(res['stdout'])
    else:
        ret['result'] = False
        ret['error'] = res['stderr']
    return ret
Open child flow and account its' reported resource usage.
dataset/ETHPy150Open saltstack/salt/salt/modules/osquery.py/_osquery--crossover with--dataset/ETHPy150Open google/grr/grr/lib/hunts/standard.py/GenericHunt.StoreResourceUsage