CLI tool to convert JSON copied from the kibana console back to valid JSON
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A simple helper to reformat JSON pasted from Kibana that uses the famous triple ticks (""") and thus has multi line scripts and broken search queries back to valid JSON.

This helps to run jq or JSON formatting tools on the command line against those JSON files.

The tool checks for beginning and end of triple double quotes, escapes all double quotes within and also condenses everything down to one line (this might result in invalid painless scripts, but keeps valid JSON).


First, make sure you have crystal installed. See the crystal install docs.

Second, run crystal build --release src/ and use the kibana2json binary created in the directory.


kibana2json reads from stdin only. The only options available are --version and --help.

I usually use it like this

# echo '{ "foo" : """what"ever""" }' | ./kibana2json | python -mjson.tool

or with JQ

echo '{ "foo" : """what"ever""" }' | ./kibana2json | jq ".foo"


Most likely you found a bug in this pretty raw tool. In that case please write a failing test in spec/, fix it and open a pull request. Alternatively open an issue with a sample snippet of JSON and I'll take a look at it when possible.

You can run the tests locally by running crystal spec.


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request


  • spinscale Alexander Reelsen - creator, maintainer