Skip to content

Idea: osquery integration with xonsh shell #53

@anki-code

Description

@anki-code

The initial idea in #52. The same could be for https://osquery.io/

def osq(query):
    json_data = $(osqueryi --json @(query))
    df = @.imp.pandas.DataFrame(@.imp.json.loads(json_data))
    return df

files_df = osq('select pid, name from processes')
files_df
# DataFrame

or with macro

def osq(*a, **kw):
    json_data = $(osqueryi --json @(', '.join(a)))
    df = @.imp.pandas.DataFrame(@.imp.json.loads(json_data))
    return df

files_df = osq!(select pid, name from processes)
files_df
# DataFrame

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions