Updated query type

This commit is contained in:
Juan Fernandez 2023-07-06 16:19:28 -04:00
parent ccb365e81d
commit fcea5a833c
No known key found for this signature in database
2 changed files with 16 additions and 2 deletions

View file

@ -31,7 +31,7 @@ func Up_20230706141219(tx *sql.Tx) error {
ADD platform VARCHAR(255) DEFAULT NULL,
ADD min_osquery_version VARCHAR(255) DEFAULT NULL,
ADD frequency_seconds INT(10) UNSIGNED DEFAULT 0,
ADD interval INT(10) UNSIGNED DEFAULT 0,
ADD automations_enabled TINYINT(1) UNSIGNED DEFAULT 0,
ADD logging_type VARCHAR(255) DEFAULT 'snapshot',

View file

@ -17,7 +17,21 @@ type QueryPayload struct {
type Query struct {
UpdateCreateTimestamps
ID uint `json:"id"`
ID uint `json:"id"`
// TeamID to which team this query belongs. If not set, then the query belongs to the 'Global'
// team.
TeamID *uint `json:"team_id" db:"team_id"`
// Interval frequency of execution (in seconds), if 0 then, this query will never run.
Interval uint `json:"interval" db:"interval"`
// Platform if set, specifies the platform(s) this query will target.
Platform *string `json:"platform" db:"platform"`
// MinOsqueryVersion if set, specifies the min required version of osquery that must be
// installed on the host.
MinOsqueryVersion *string `json:"min_osquery_version" db:"min_osquery_version"`
// AutomationsEnabled whether to send data to the configured log destination
AutomationsEnabled bool `json:"automations_enabled" db:"automations_enabled"`
// LoggingType the type of log output for this query
LoggingType string `json:"logging" db:"logging_type"`
Name string `json:"name"`
Description string `json:"description"`
Query string `json:"query"`