Last active
October 18, 2019 13:07
-
-
Save bandaangosta/1213432b320c58a95b38d94b850f2f6f to your computer and use it in GitHub Desktop.
Kibana search results (exported to CSV) to JIRA table format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/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