ksconf promote

Propagate .conf settings applied in one file to another. Typically this is used to take local changes made via the UI and push them into a default (or default.d/) location.

NOTICE: By default, changes are MOVED, not just copied.

Promote has two different modes: batch and interactive. In batch mode all changes are applied automatically and the (now empty) source file is removed. In interactive mode the user is prompted to pick which stanzas and keys to integrate. This can be used to push changes made via the UI, which are stored in a ‘local’ file, to the version-controlled ‘default’ file. Note that the normal operation moves changes from the SOURCE file to the TARGET, updating both files in the process. But it’s also possible to preserve the local file, if desired.

If either the source file or target file is modified while a promotion is under progress, changes will be aborted. And any custom selections you made will be lost. (This needs improvement.)

usage: ksconf promote [-h] [--batch | --interactive] [--force] [--keep]
                      [--keep-empty]
                      SOURCE TARGET

Positional Arguments

SOURCE The source configuration file to pull changes from. Typically the ‘local’ conf file)
TARGET Configuration file or directory to push the changes into. (Typically the ‘default’ folder) As a shortcut, a directory is given, then it’s assumed that the same basename is used for both SOURCE and TARGET. In fact, if different basename as provided, a warning is issued.

Named Arguments

--batch, -b Use batch mode where all configuration settings are automatically promoted. All changes are removed from source and applied to target. The source file will be removed, unless ‘–keep-empty’ is used.
--interactive, -i
 Enable interactive mode where the user will be prompted to approve the promotion of specific stanzas and keys. The user will be able to apply, skip, or edit the changes being promoted. (This functionality was inspired by ‘git add –patch’).
--force, -f Disable safety checks.
--keep, -k Keep conf settings in the source file. All changes will be copied into the target file instead of being moved there. This is typically a bad idea since local always overrides default.
--keep-empty Keep the source file, even if after the settings promotions the file has no content. By default, SOURCE will be removed after all content has been moved into TARGET. Splunk will re-create any necessary local files on the fly.