A complete revival and rewrite of the Kibana Object Manager plugin.
The intent of kibob is to provide a Git-inspired interface for managing Kibana saved objects.
This script depends on a few other command-line utilities:
jsrmx- bundle and unbundle NDJSON: https://github.com/VimCommando/jsrmxcurl- make HTTP requests to Kibana: https://curl.se/jq- format, parse, and update JSON: https://stedolan.github.io/jq/grep- filtering and searching text: https://www.gnu.org/software/grep/
Almost every modern unix-based system has grep and curl installed. You'll find jq in every package repo. For jsrmx the easiest way is through Rust's cargo package manager at https://doc.rust-lang.org/cargo/getting-started/installation.html.
- Clone this repository
- Symlink
kibobto your$PATH - Download the
export.ndjsonfrom Kibana and copy it into a new folder - In the new folder, run
git initto initialize a new Git repository - Run
kibob initto slice up theexport.ndjsoninto separate files with amanifest.json - Use
git add .andgit commit -m "Initial commit"
You're now tracking your Kibana objects with source control!
⚠️ This script will modify theexport.ndjsonfile. Make sure you made a copy in step 3.
- Copy the
dotenv/localhostto a.envfile in your new repo - Update with your Kibana URL and credentials
- Use
kibob pullto fetch updates to any objects listed in themanifest.json
Now use your favorite Git client to review the changes, add and commit as normal.
Any changes made in the repository can be pushed back to Kibana using kibob push. Where this is most useful is across different environments, such as development and production. Simply make a different .env file for each environment.
For example use the default .env for your development environment, and create an .env.prod for your production environment.
kibob pull
kibob push --env prodThis will pull all the objects listed in the manifest.json from your dev cluster and push them to your prod cluster! By default all objects are imported with the managed: true flag set, so no changes can be made directoy in production.
Kibana Object Manager: --{kibob}-> is the Git-flavored side dish to prepare Kibana saved objects for version control!
kibob <command> [options] <arguments>
initSlice up anexport.ndjsoninto objects files and create amanifest.jsonauthTest authorization to a Kibana remotepullFetch saved objects from a Kibana remotepushUpdate saved objects in a Kibana remoteaddAdd saved objects to the manifesttogoOrder your Kibana objects to go! (bundle an NDJSON for distribution)helpGet detailed help, use a command name as the argument
-e, --env <NAME|FILE>- The.env.NAMEorFILEfile to source credentials from (default.env)-s, --space <ID>- Kibana space id to use (defaultdefault)--debug- More verbose logging and retention of temporary files
kibob add [output_dir]
Add an object to the menu, err, repository. Exports saved objects by ID, including related objects. Adds entries to the [output_dir]/manifest.json and moves objects into <output_dir>/objects/*.json
Options:
-o, --objects <IDS>- Comma-separated list of"type=uuid"objects to export from Kibana-f, --file <FILE>- Filename of anexport.ndjsonto merge into existing manifest
Arguments:
[output_dir]- Directory to save the exported objects to. Must contain amanifest.jsonfile. (default.)
kibob auth
Tests the Kibana authorization configuration
kibob init [export] [manifest_file]
Initializes a Kibana object repository from an export.ndjson.
Arguments:
[export]- An NDJSON file or directory with anexport.ndjsonto build a manifest file from (default:export.ndjson)[manifest_file]- The manifest file to generate (default:manifest.json)
kibob pull [output_dir]
Export and unbundle the Kibana saved objects listed in [output_dir]/manifest.json into [output_dir]/objects/*.json objects.
Arguments:
[output_dir]- Directory to save exported objects to. Must contain amanifest.jsonfile.
kibob push [input_dir]
Bundle up the [input_dir]/objects/*.json objects to go and deliver them to Kibana!
Options:
-c, --clean <bool>- Keep the temporary files and directories. (default:true)-m, --managed <bool>- Set"managed: false"to allow direct editing in Kibana. (Default:true)
Arguments:
[input_dir]- A directory containing themanifest.jsonfile to import. (default:.)
kibob togo [input_dir]
Bundle up the [input_dir]/objects/*.json objects into a distributable NDJSON file named ${input_dir}.ndjson
Options:
-m, --managed <bool>- Set"managed: false"to allow direct editing in Kibana. (Default:true)
Arguments:
[input_dir]- Directory containing the objects to bundle (default:.)