forked from f5devcentral/f5-waf-elk-dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.sh
12 lines (12 loc) · 845 Bytes
/
helpers.sh
1
2
3
4
5
6
7
8
9
10
11
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'
}