# Checklist for submitter If some of the following don't apply, delete the relevant line. - [ ] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. See [Changes files](https://fleetdm.com/docs/contributing/committing-changes#changes-files) for more information. - [ ] Documented any API changes (docs/Using-Fleet/REST-API.md or docs/Contributing/API-for-contributors.md) - [ ] Documented any permissions changes (docs/Using Fleet/manage-access.md) - [ ] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [ ] Added support on fleet's osquery simulator `cmd/osquery-perf` for new osquery data ingestion features. - [ ] Added/updated tests - [ ] Manual QA for all new/changed functionality - For Orbit and Fleet Desktop changes: - [ ] Manual QA must be performed in the three main OSs, macOS, Windows and Linux. - [ ] Auto-update manual QA, from released version of component to new version (see [tools/tuf/test](../tools/tuf/test/README.md)).
4.8 KiB
Fleet UI
Create a query
Queries in Fleet allow you to ask a multitude of questions to help you manage, monitor, and identify threats on your devices.
If you're unsure of what to ask, head to Fleet's query library. There you'll find common queries that have been tested by members of our community.
How to create a query:
-
In the top navigation, select Queries.
-
Select Create new query to navigate to the query console.
-
In the Query field, enter your query. Remember, you can find common queries in Fleet's library.
-
Select Save, enter a name and description for your query, select the frequency that the query should run at, and select Save query.
Run a query
Run a live query to get answers for all of your online hosts.
Offline hosts won’t respond to a live query because they may be shut down, asleep, or not connected to the internet.
How to run a query:
-
In the top navigation, select Queries.
-
In the Queries table, find the query you'd like to run and select the query's name to navigate to the query console.
-
Select Run query to navigate to the target picker. Select All hosts and select Run. This will run the query against all your hosts.
The query may take several seconds to complete because Fleet has to wait for the hosts to respond with results.
Fleet's query response time is inherently variable because of osquery's heartbeat response time. This helps prevent performance issues on hosts.
Schedule a query
In Fleet 4.35.0, the "Schedule" page was removed, and query automations are now configured on the "Queries" page. Instructions for scheduling queries in earlier versions of Fleet can be found here.
Only users with the admin role can manage query automations.
Fleet allows you to schedule queries to run at a set frequency. Scheduled queries will send data to your log destination automatically.
The default log destination, filesystem, is good to start. With this set, data is sent to the /var/log/osquery/osqueryd.snapshots.log
file on each host’s filesystem. To see which log destinations are available in Fleet, head to the log destinations page.
By default, queries that run on a schedule will only target platforms compatible with that query. This behavior can be overridden by setting the platforms in "advanced options" when saving a query.
How to schedule queries:
-
In the top navigation, select Queries.
-
Select Manage automations.
-
Check the box next to the queries you want to automate, and select Save.
The frequency that queries run at is set when a query is created.
With Fleet Premium, you can schedule queries for groups of hosts using the teams feature. This allows you to collect different data for each group.
In Fleet Premium, groups of hosts are called "teams."
How to use teams to schedule queries for a group of hosts:
-
If you haven't already, first create a team and transfer hosts to the team.
-
In the top navigation, select Queries.
-
In the Teams dropdown below the top navigation, select the team you want to manage automation for.
-
Select Manage automations
-
Select the queries you want to run on a schedule for this team, and select Save.
Note: Only queries that belong to the selected team will be listed. When configuring query automations for all hosts, only global queries will be listed.
Update agent options
This content was relocated on 31st August 2023.
See "Agent configuration" to learn how to simultaneously update agent options from the Fleet UI or fleetctl command line tool.