Skip to content
Commitpedia
Log in Join & edit

osquery: query your endpoints like a SQL database

osquery exposes the state of a Linux, macOS or Windows machine as SQL tables, so you can ask which processes are listening, which users exist or which kernel modules are loaded with a normal SELECT statement.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of osquery: query your endpoints like a SQL database: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
osquery/osquery

osquery/osquery

Stars
23.7k
Forks
2.6k
Language
C++
Licence
NOASSERTION
Last push
14 Oct 2026

On GitHub: SQL powered operating system instrumentation, monitoring, and analytics.

Open on GitHub

osquery (about 24,000 stars on GitHub) is an operating system instrumentation framework that presents a computer as a relational database. It was created at Facebook in 2014 to monitor its own fleet of servers and laptops and was transferred to the Linux Foundation in 2019, where it is run by the osquery Foundation with maintainers from several companies. The code is C++ and ships as a single binary for Linux, macOS and Windows.

What it does

osquery implements hundreds of virtual tables, each backed by a system API rather than stored data: processes, listening_ports, users, logged_in_users, crontab, kernel_modules, installed package tables for each package manager, browser extensions, launch agents on macOS, services and registry keys on Windows, and many more. You query them with ordinary SQLite syntax, including joins. The interactive shell osqueryi is useful for one off investigation; the daemon osqueryd runs scheduled queries, records how results change over time and writes the differences as logs. Shipped to a central collector, those logs give a fleet wide view of configuration and activity, and they are a common input to detection rules and compliance checks.

Who it is for

  • Security teams that need a uniform way to ask every machine the same question, for example whether a vulnerable package is installed anywhere.
  • System administrators who want inventory and change tracking without agents from several vendors.
  • Incident responders who need to inspect a live system quickly with a language they already know.
  • Builders of endpoint products: several commercial and open source fleet managers such as Fleet and Kolide are built around osquery.

How to install it

The project publishes packages and installers for every supported platform, plus repositories for Debian, Ubuntu and Red Hat families. Installing the package and opening the shell is enough to start exploring:

Check before you run this

  • Runs with administrator rights. Make sure you understand every line.
sudo apt install osquery
osqueryi "SELECT pid, name, path FROM processes WHERE name LIKE '%ssh%';"

Running the daemon across many machines normally goes through a fleet manager, which distributes query packs and collects results. The documentation has a full table schema browser and deployment guides.

Credit

osquery was created by Facebook engineers and is maintained by the osquery Foundation under the Linux Foundation, with a technical steering committee drawn from the community. The code is dual licensed under the Apache License 2.0 and the GNU General Public License version 2, at the user’s choice.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +2,560 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?