From 2d249ac6b1e7da4c2b7dacd251bc0dd587a44cf3 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Fri, 31 Jan 2020 17:43:04 +0000 Subject: [PATCH] tweak export script for new references --- bin/export_kibana-objects.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/export_kibana-objects.sh b/bin/export_kibana-objects.sh index d7f94465..6cea65f5 100755 --- a/bin/export_kibana-objects.sh +++ b/bin/export_kibana-objects.sh @@ -32,7 +32,7 @@ trap fuCLEANUP EXIT # Export index patterns mkdir -p patterns echo $myCOL1"### Now exporting"$myCOL0 $myINDEXCOUNT $myCOL1"index pattern fields." $myCOL0 -curl -s -XGET ''$myKIBANA'api/saved_objects/index-pattern/'$myINDEXID'' | jq '. | {attributes}' > patterns/$myINDEXID.json & +curl -s -XGET ''$myKIBANA'api/saved_objects/index-pattern/'$myINDEXID'' | jq '. | {attributes, references}' > patterns/$myINDEXID.json & echo # Export dashboards @@ -41,7 +41,7 @@ echo $myCOL1"### Now exporting"$myCOL0 $(echo $myDASHBOARDS | wc -w) $myCOL1"das for i in $myDASHBOARDS; do echo $myCOL1"###### "$i $myCOL0 - curl -s -XGET ''$myKIBANA'api/saved_objects/dashboard/'$i'' | jq '. | {attributes}' > dashboards/$i.json & + curl -s -XGET ''$myKIBANA'api/saved_objects/dashboard/'$i'' | jq '. | {attributes, references}' > dashboards/$i.json & done; echo @@ -51,7 +51,7 @@ echo $myCOL1"### Now exporting"$myCOL0 $(echo $myVISUALIZATIONS | wc -w) $myCOL1 for i in $myVISUALIZATIONS; do echo $myCOL1"###### "$i $myCOL0 - curl -s -XGET ''$myKIBANA'api/saved_objects/visualization/'$i'' | jq '. | {attributes}' > visualizations/$i.json & + curl -s -XGET ''$myKIBANA'api/saved_objects/visualization/'$i'' | jq '. | {attributes, references}' > visualizations/$i.json & done; echo @@ -61,7 +61,7 @@ echo $myCOL1"### Now exporting"$myCOL0 $(echo $mySEARCHES | wc -w) $myCOL1"searc for i in $mySEARCHES; do echo $myCOL1"###### "$i $myCOL0 - curl -s -XGET ''$myKIBANA'api/saved_objects/search/'$i'' | jq '. | {attributes}' > searches/$i.json & + curl -s -XGET ''$myKIBANA'api/saved_objects/search/'$i'' | jq '. | {attributes, references}' > searches/$i.json & done; echo