Skip to content

Docs on running queries within subprocess/calling osqueryi from python  #12

@arubdesu

Description

@arubdesu

Pardon if this is the wrong place to open this issue. So far I can't figure out how to call osqueryi from within a python script, which I'm not sure if this module would help with after seeing #11. example:

cmd = ['/usr/local/bin/osqueryi', '--csv', '"select name, path from kernel_extensions"']
proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
list_with_pipes = proc.communicate()[0]
print list_with_pipes

Without setting shell=True I get a syntax error, but even with that, or using subprocess.check_output, I'm just getting an empty string. Halp?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions