Skip to content

Commit

Permalink
Merge pull request #15 from 464d41/store-dashboards-as-json
Browse files Browse the repository at this point in the history
Store dashboards as json
  • Loading branch information
464d41 authored Oct 29, 2020
2 parents 731bc64 + 3598549 commit 38d5911
Show file tree
Hide file tree
Showing 5 changed files with 5,935 additions and 2 deletions.
12 changes: 12 additions & 0 deletions helpers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ndjson2json () {
jq '. | if .attributes.fields then .attributes.fields|=fromjson else . end
| if .attributes.visState then .attributes.visState|=fromjson else . end
| if .attributes.kibanaSavedObjectMeta.searchSourceJSON then .attributes.kibanaSavedObjectMeta.searchSourceJSON|=fromjson else . end
| if .attributes.panelsJSON then .attributes.panelsJSON|=fromjson else . end'
}
json2ndjson () {
jq -c '. | if .attributes.fields then .attributes.fields|=tojson else . end
| if .attributes.visState then .attributes.visState|=tojson else . end
| if .attributes.kibanaSavedObjectMeta.searchSourceJSON then .attributes.kibanaSavedObjectMeta.searchSourceJSON|=tojson else . end
| if .attributes.panelsJSON then .attributes.panelsJSON|=tojson else . end'
}
Loading

0 comments on commit 38d5911

Please sign in to comment.