From f648949ebefe992ab87fea84ba930c8199c254c2 Mon Sep 17 00:00:00 2001 From: Desmi-Dizney <99777687+Desmi-Dizney@users.noreply.github.com> Date: Fri, 20 May 2022 12:07:32 -0500 Subject: [PATCH] Editor pass - Support per-task configuration for async host processing configuration (#5810) * Editor pass - Support per-task configuration for async host processing configuration # Editor pass for: - https://github.com/fleetdm/fleet/pull/5700 * Update Configuration.md * Update config.go --- docs/Deploying/Configuration.md | 6 +++--- server/config/config.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Deploying/Configuration.md b/docs/Deploying/Configuration.md index 4a700be3ba..deb6fe97b2 100644 --- a/docs/Deploying/Configuration.md +++ b/docs/Deploying/Configuration.md @@ -1071,7 +1071,7 @@ to the amount of time it takes for Fleet to give the host the label queries. Note that currently, if both the failing policies webhook *and* this `osquery.enable_async_host_processing` option are set, some failing policies webhooks could be missing (some transitions from succeeding to failing or vice-versa could happen without triggering a webhook request). -It can be set to a single boolean value ("true" or "false"), which controls all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g. "label_membership=true&policy_membership=true". When using the per-task syntax, omitted tasks get the default value. The supported async task names are: +It can be set to a single boolean value ("true" or "false"), which controls all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g., "label_membership=true&policy_membership=true". When using the per-task syntax, omitted tasks get the default value. The supported async task names are: * `label_membership` for updating the hosts' label query execution; * `policy_membership` for updating the hosts' policy membership results; @@ -1090,7 +1090,7 @@ It can be set to a single boolean value ("true" or "false"), which controls all Applies only when `osquery_enable_async_host_processing` is enabled. Sets the interval at which the host data will be collected into the database. Each Fleet instance will attempt to do the collection at this interval (with some optional jitter added, see `osquery_async_host_collect_max_jitter_percent`), with only one succeeding to get the exclusive lock. -It can be set to a single duration value (e.g. "30s"), which defines the interval for all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g. "label_membership=10s&policy_membership=1m". When using the per-task syntax, omitted tasks get the default value. See [osquery_enable_async_host_processing](#osquery_enable_async_host_processing) for the supported async task names. +It can be set to a single duration value (e.g., "30s"), which defines the interval for all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g., "label_membership=10s&policy_membership=1m". When using the per-task syntax, omitted tasks get the default value. See [osquery_enable_async_host_processing](#osquery_enable_async_host_processing) for the supported async task names. - Default value: 30s - Environment variable: `FLEET_OSQUERY_ASYNC_HOST_COLLECT_INTERVAL` @@ -1118,7 +1118,7 @@ Applies only when `osquery_enable_async_host_processing` is enabled. A number in Applies only when `osquery_enable_async_host_processing` is enabled. Timeout of the lock acquired by a Fleet instance to collect host data into the database. If the collection runs for too long or the instance crashes unexpectedly, the lock will be automatically released after this duration and another Fleet instance can proceed with the next collection. -It can be set to a single duration value (e.g. "1m"), which defines the lock timeout for all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g. "label_membership=2m&policy_membership=5m". When using the per-task syntax, omitted tasks get the default value. See [osquery_enable_async_host_processing](#osquery_enable_async_host_processing) for the supported async task names. +It can be set to a single duration value (e.g., "1m"), which defines the lock timeout for all async host processing tasks, or it can be set for specific async tasks using a syntax similar to an URL query string or parameters in a Data Source Name (DSN) string, e.g., "label_membership=2m&policy_membership=5m". When using the per-task syntax, omitted tasks get the default value. See [osquery_enable_async_host_processing](#osquery_enable_async_host_processing) for the supported async task names. - Default value: 1m - Environment variable: `FLEET_OSQUERY_ASYNC_HOST_COLLECT_LOCK_TIMEOUT` diff --git a/server/config/config.go b/server/config/config.go index 3d17e03890..e68d108223 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -498,13 +498,13 @@ func (man Manager) addConfigs() { man.addConfigInt("osquery.max_jitter_percent", 10, "Maximum percentage of the interval to add as jitter") man.addConfigString("osquery.enable_async_host_processing", "false", - "Enable asynchronous processing of host-reported query results (either 'true'/'false' or set per task, e.g. 'label_membership=true&policy_membership=true')") + "Enable asynchronous processing of host-reported query results (either 'true'/'false' or set per task, e.g., 'label_membership=true&policy_membership=true')") man.addConfigString("osquery.async_host_collect_interval", (30 * time.Second).String(), "Interval to collect asynchronous host-reported query results (e.g. '30s' or set per task 'label_membership=10s&policy_membership=1m')") man.addConfigInt("osquery.async_host_collect_max_jitter_percent", 10, "Maximum percentage of the interval to collect asynchronous host results") man.addConfigString("osquery.async_host_collect_lock_timeout", (1 * time.Minute).String(), - "Timeout of the exclusive lock held during async host collection (e.g. '30s' or set per task 'label_membership=10s&policy_membership=1m'") + "Timeout of the exclusive lock held during async host collection (e.g., '30s' or set per task 'label_membership=10s&policy_membership=1m'") man.addConfigDuration("osquery.async_host_collect_log_stats_interval", 1*time.Minute, "Interval at which async host collection statistics are logged (0 disables logging of stats)") man.addConfigInt("osquery.async_host_insert_batch", 2000, @@ -1011,7 +1011,7 @@ func (man Manager) getConfigDuration(key string) time.Duration { // panics if the config is invalid, this is handled by Viper (this is how all // getConfigT helpers indicate errors). The default value is only applied if -// there is no task-specific config (i.e. no "task=true" config format for that +// there is no task-specific config (i.e., no "task=true" config format for that // task). If the configuration key was not set at all, it automatically // inherited the general default configured for that key (via // man.addConfigBool).