-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Placeholder fields and Osquery UI updates (#3045)
Co-authored-by: Joe Peeples <[email protected]> Co-authored-by: Benjamin Ironside Goldstein <[email protected]> Co-authored-by: Janeen Mikell Roberts <[email protected]>
- Loading branch information
1 parent
3c52d03
commit 2cf53b7
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[[osquery-placeholder-fields]] | ||
== Use placeholder fields in Osquery queries | ||
|
||
Instead of hard-coding alert and event values into Osquery queries, you can use placeholder fields to dynamically pass this data into queries. Placeholder fields function like parameters. You can use placeholder fields to build flexible and reusable queries. | ||
|
||
Placeholder fields work in single queries or query packs. They're also supported in the following features: | ||
|
||
* <<alerts-run-osquery,Live queries>> | ||
* <<osquery-response-action,Osquery Response Actions>> | ||
+ | ||
* <<invest-guide-run-osquery,Investigation guides using Osquery queries>> | ||
|
||
[float] | ||
[[placeholder-field-syntax]] | ||
=== Placeholder field syntax and requirements | ||
|
||
Placeholder fields use http://mustache.github.io/[mustache syntax] and must be wrapped in double curly brackets (`{{example.field}}`). You can use any field within an event or alert document as a placeholder field. | ||
|
||
Queries with placeholder fields can only run against alerts or events. Otherwise, they will lack the necessary values and the query status will be `error`. | ||
|
||
[float] | ||
[[placeholder-field-example]] | ||
==== Example query with a placeholder field | ||
|
||
The following query uses the `{{host.name}}` placeholder field: | ||
|
||
`SELECT * FROM os_version WHERE name = `{{host.os.name}}`` | ||
|
||
When you run the query, the value that's stored in the alert or event's `host.name` field will be transferred to the `{{host.os.name}}` placeholder field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters