/Kibana

Kibana 4 configuration index interaction (.kibana index control, import and export of config, dashboards, visualizations, searches)

Primary LanguagePythonMIT LicenseMIT

      :::    :::::::::::::::::::::::     :::    ::::    :::    :::
     :+:   :+:     :+:    :+:    :+:  :+: :+:  :+:+:   :+:  :+: :+:
    +:+  +:+      +:+    +:+    +:+ +:+   +:+ :+:+:+  +:+ +:+   +:+
   +#++:++       +#+    +#++:++#+ +#++:++#++:+#+ +:+ +#++#++:++#++:
  +#+  +#+      +#+    +#+    +#++#+     +#++#+  +#+#+#+#+     +#+
 #+#   #+#     #+#    #+#    #+##+#     #+##+#   #+#+##+#     #+#
###    ####################### ###     ######    #######     ###

Kibana: a CLI for Kibana v4 configuration (.kibana index interaction)

$ python -m kibana --help
usage: [-h] [--status STATUS_IDX] [--refresh REFRESH_IDX]
       [--poll POLL_IDX] [--export EXPORT_OBJ]
       [--import IMPORT_FILE] [--pkg] [--outdir OUTPUT_PATH]
       [--host HOST]

.kibana interaction module

optional arguments:
  -h, --help            show this help message and exit
  --status STATUS_IDX, -s STATUS_IDX
                        exit code is mapping status
  --refresh REFRESH_IDX, -r REFRESH_IDX
                        refreshes mapping
  --poll POLL_IDX, -p POLL_IDX
                        periodically polls (15s) mapping and refreshes if necessary
  --export EXPORT_OBJ, -e EXPORT_OBJ
                        [all|config|dashboard name] to json individual/pkg
                        default: all
  --import IMPORT_FILE, -i IMPORT_FILE
                        import .kibana json obj/pkg
  --pkg                 use pkg mode for import/export
  --outdir OUTPUT_PATH, -o OUTPUT_PATH
                        export only: output file(s) directory
  --host HOST           ES host to use, format ip:port
                        default: 127.0.0.1:9200

Mapping Cache Examples/refreshFields() Emulation

  • Refresh fields' mapping cache for index pattern 'aaa*'
    • python -m kibana --refresh 'aaa*'
  • Check the status of a mapping cache:
    • python -m kibana --status 'aaa*'
  • Periodically enforce mapping cache correctness using ES node 10.0.0.1:
    • python -m kibana --poll 'aaa*' --host 10.0.0.1:9200

Import/Export Object Examples

  • Get all objects into a single file all-Pkg.json under tmp under current working directory:
    • python -m kibana --export all --pkg --outdir tmp
  • Get dashboard named 'Big Picture' (and all its vis/search):
    • python -m kibana --export Big-Picture --pkg --outdir tmp
  • Same, but each object in its own file:
    • python -m kibana --export Big-Picture --outdir tmp