Skip to content

Instantly share code, notes, and snippets.

@bandaangosta
Last active October 18, 2019 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bandaangosta/1213432b320c58a95b38d94b850f2f6f to your computer and use it in GitHub Desktop.
Save bandaangosta/1213432b320c58a95b38d94b850f2f6f to your computer and use it in GitHub Desktop.
Kibana search results (exported to CSV) to JIRA table format
# !/bin/bash
# Steps:
# - Run query in Kibana
# - Export results to CSV file: Share -> CSV Reports -> Generate CSV
# (you may be required to "Save search" first. Use a temporary name and keep overwriting it to reduce entries)
# - Download generated CSV once generated (it takes a short while)
# - Run script on local file as shown below
# - Profit
#
# Usage example:
# $ kibana_csv_jira.sh tmp_export_csv.csv
#
# Output in:
# /tmp/tmp_export_csv.csv.jira
# Requires: apt install csvkit
csvformat -T -Q \" -U 1 "$1" | sed -e 's/^"/|/g' -e 's/"$/|/g' -e 's/\t/|/g' -e 's/"//g' > /tmp/"$(basename "$1")".jira
echo "Output in:"
echo /tmp/$(basename "$1").jira
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment