Skip to content

Commit a21ce69

Browse files
author
Teddy Reed
committed
Update README.rst
1 parent ad40835 commit a21ce69

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@ Extensions are the core way that you can extend and customize osquery. At
8181
Facebook, we use extensions extensively to implement many plugins that take
8282
advantage of internal APIs and tools.
8383

84+
Execute queries in Python
85+
-------------------------
86+
87+
The same Thirft bindings can be used to create a Python client for the osqueryd or
88+
osqueryi's extension socket. There are helper classes provided that spawn an ephemeral
89+
osquery process for consecutive or long running client instances.
90+
91+
.. code-block:: python
92+
93+
import osquery
94+
95+
if __name__ == "__main__":
96+
# Spawn an osquery process using an ephemeral extension socket.
97+
instance = osquery.SpawnInstance()
98+
instance.open()
99+
100+
# Issues queries and call osquery Thrift APIs.
101+
instance.client.query("select timestamp from time")
102+
84103
Install
85104
-------
86105

0 commit comments

Comments
 (0)