Skip to content

Export and unbundle Kibana saved objects for simpler version management

License

Notifications You must be signed in to change notification settings

VimCommando/kibana-object-manager

Repository files navigation

Kibana Object Manager

A Git-inspired CLI tool for managing Kibana saved objects in version control. Built with Rust for reliability, speed, and modern DevOps workflows.

What is kibob?

kibob (Kibana Object Manager) helps you manage Kibana dashboards, visualizations, and other saved objects using a familiar Git-like workflow. Version control your Kibana artifacts alongside your application code, deploy them across environments, and collaborate with your team using standard Git practices.

Key Features

  • Git-like workflow - pull, push, and version control your Kibana objects
  • Spaces management - Version control and deploy Kibana spaces alongside objects
  • Workflows management - Version control and deploy Kibana workflows
  • Environment management - Easy deployment across dev, staging, and production
  • Manifest-based tracking - Explicitly define which objects, spaces, and workflows to manage
  • Managed vs. unmanaged - Control whether objects can be edited in Kibana UI
  • Modern architecture - Built with async Rust, no external dependencies
  • Fast and reliable - ETL pipeline design with proper error handling

Installation

From Cargo (Recommended)

cargo install kibana-object-manager

From Source

git clone https://github.com/VimCommando/kibana-object-manager.git
cd kibana-object-manager
cargo build --release
# Binary will be at target/release/kibob

Future: Homebrew

brew install kibob  # Coming soon!

Quick Start

1. Set up environment variables

export KIBANA_URL=http://localhost:5601
export KIBANA_USERNAME=elastic
export KIBANA_PASSWORD=changeme
# OR use API key authentication:
# export KIBANA_APIKEY=your_api_key_here

2. Test your connection

kibob auth

3. Initialize a project from an export

First, export your dashboards from Kibana UI (Stack Management → Saved Objects → Export).

kibob init export.ndjson ./my-dashboards
cd my-dashboards

This creates:

  • default/manifest/saved_objects.json - Tracks which objects to manage
  • default/objects/ - Directory with your objects organized by type

Optional: Add spaces management

Create a spaces.yml to also manage Kibana spaces:

spaces:
  - id: default
    name: Default
  - id: marketing
    name: Marketing
  - id: engineering
    name: Engineering

Now pull and push will also manage spaces! Each space's definition will be stored at {space_id}/space.json. See Spaces Guide for details.

Optional: Add workflows management

Create per-space workflow manifests like default/manifest/workflows.yml:

workflows:
  - id: workflow-123
    name: my-workflow
  - id: workflow-456
    name: alert-workflow
  - id: workflow-789
    name: data-pipeline

Now pull and push will also manage workflows!

4. Version control with Git

git init
git add .
git commit -m "Initial dashboard import"

5. Pull changes from Kibana

kibob pull .
git diff  # Review changes
git add . && git commit -m "Update from Kibana"

6. Push to another environment

# Set production credentials
export KIBANA_URL=https://prod-kibana.example.com
export KIBANA_APIKEY=prod_api_key

# Deploy as managed objects (read-only in Kibana UI)
kibob push . --managed true

CLI Commands

kibob auth

Test connection to Kibana with current credentials.

kibob init <export.ndjson> <output_dir>

Initialize a new project from a Kibana export file.

kibob pull <dir> [--space <name>]

Fetch saved objects from Kibana (specified in manifest) and save to local files. Also pulls spaces if spaces.yml exists and workflows if per-space manifest/workflows.yml files exist.

  • --space <name>: Override the Kibana space (overrides KIBANA_SPACE env var)

kibob push <dir> [--managed true|false] [--space <name>]

Upload local objects to Kibana. Also pushes spaces if spaces.yml exists and workflows if per-space manifest/workflows.yml files exist.

  • --managed true (default): Objects are read-only in Kibana UI
  • --managed false: Objects can be edited in Kibana UI
  • --space <name>: Override the Kibana space (overrides KIBANA_SPACE env var)

kibob add <api> <dir> [options]

Add items to an existing manifest. Supports: objects, workflows, spaces

For Workflows:

  • kibob add workflows . - Search and add all workflows
  • kibob add workflows . --query "alert" - Search workflows matching "alert"
  • kibob add workflows . --include "^prod" - Include workflows matching regex "^prod"
  • kibob add workflows . --exclude "test" - Exclude workflows matching regex "test"
  • kibob add workflows . --include "(?i)prod" - Case-insensitive include
  • kibob add workflows . --file export.json - Add from API response file
  • kibob add workflows . --file bundle.ndjson - Add from bundle file

For Spaces:

  • kibob add spaces . - Fetch and add all spaces
  • kibob add spaces . --include "prod|staging" - Include spaces matching pattern
  • kibob add spaces . --exclude "(?i)test" - Exclude test spaces (case-insensitive)
  • kibob add spaces . --file spaces.json - Add from API response file
  • kibob add spaces . --file bundle.ndjson - Add from bundle file

For Objects (legacy):

  • kibob add objects . --objects "dashboard=abc123,visualization=xyz789"
  • kibob add objects . --file export.ndjson

Regex Filtering:

  • --include and --exclude accept standard Rust regex patterns
  • Include filter is applied first, then exclude filter
  • Use (?i) prefix for case-insensitive matching
  • Examples: ^prod, test$, (?i)staging, dev|test

kibob togo <dir>

Bundle objects into a distributable bundle/ directory containing NDJSON files:

  • bundle/{space_id}/saved_objects.ndjson - Per-space saved objects
  • bundle/spaces.ndjson - Spaces (if spaces.yml exists)
  • bundle/{space_id}/workflows.ndjson - Per-space workflows (if manifest/workflows.yml exists)

The bundle directory can be easily zipped for distribution.

kibob migrate <dir>

Migrate legacy manifest.json to new manifest/saved_objects.json format.

Use Cases

For Kibana Admins

Back up and version control your dashboards. Easily restore or roll back changes.

For Developers

Store dashboards in your application's Git repository. Deploy observability alongside code.

For DevOps Engineers

Automate dashboard deployments in CI/CD pipelines. Consistent environments from dev to production.

Documentation

Authentication

kibob supports multiple authentication methods:

Basic Authentication

export KIBANA_USERNAME=elastic
export KIBANA_PASSWORD=changeme

API Key

export KIBANA_APIKEY=your_base64_encoded_key

Architecture

kibob uses a modern ETL (Extract-Transform-Load) pipeline architecture:

Pull: Kibana → Extract → Transform → Store Files
Push: Read Files → Transform → Load → Kibana

Built with:

  • Rust - Memory-safe, fast, reliable
  • Tokio - Async runtime for efficient I/O
  • reqwest - HTTP client with connection pooling
  • Clap - Modern CLI framework
  • serde - Robust JSON serialization

Project Structure

my-dashboards/
├── spaces.yml                # Global: managed spaces list
├── default/                  # Default space (self-contained)
│   ├── space.json           # Space definition
│   ├── manifest/            # Per-space manifests
│   │   ├── saved_objects.json
│   │   ├── workflows.yml
│   │   └── agents.yml
│   ├── objects/             # Saved objects organized by type
│   │   ├── dashboard/
│   │   │   ├── abc-123.json
│   │   │   └── xyz-789.json
│   │   ├── visualization/
│   │   │   └── def-456.json
│   │   └── index-pattern/
│   │       └── logs-*.json
│   ├── workflows/           # Workflow configurations
│   │   ├── my-workflow.json
│   │   └── alert-workflow.json
│   └── agents/              # Agent configurations
│       └── my-agent.json
├── marketing/               # Marketing space (self-contained)
│   ├── space.json
│   ├── manifest/
│   │   └── workflows.yml
│   └── workflows/
│       └── campaign-workflow.json
└── bundle/                  # (Generated by 'togo' command)
    ├── default/
    │   ├── saved_objects.ndjson
    │   ├── workflows.ndjson
    │   └── agents.ndjson
    ├── marketing/
    │   └── workflows.ndjson
    └── spaces.ndjson        # All space definitions

Managing Kibana Spaces

kibob can also manage Kibana Spaces alongside saved objects. Create a spaces.yml:

spaces:
  - id: default
    name: Default
  - id: marketing
    name: Marketing
  - id: engineering
    name: Engineering

Then use the same workflow:

kibob pull .    # Pulls space definitions to {space_id}/space.json
kibob push .    # Creates/updates spaces in Kibana
kibob togo .    # Bundles to bundle/spaces.ndjson

Each space's definition is stored in its own directory as {space_id}/space.json. For example:

  • default/space.json
  • marketing/space.json
  • engineering/space.json

See the Spaces Guide for complete documentation.

Migrating from Bash Version

If you have an existing project using the old Bash script:

# The new Rust version uses a different manifest format
kibob migrate ./my-project

# Review the migrated manifest
cat manifest/saved_objects.json

# Test by pulling from Kibana
kibob pull ./my-project

See Migration Guide for details.

Environment Variables Reference

Variable Description Default
KIBANA_URL Kibana base URL Required
KIBANA_USERNAME Basic auth username Optional
KIBANA_PASSWORD Basic auth password Optional
KIBANA_APIKEY API key (conflicts with user/pass) Optional

Support

Contributing

Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

About

Export and unbundle Kibana saved objects for simpler version management

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •