I have tho following JSON file
[
{
"bw-parallel-streams": "1",
"destination": "198.124",
"event-types": [
{
"base-uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/throughput-subintervals/base",
"event-type": "throughput-subintervals",
"summaries": [],
"time-updated": 1423675036
},
{
"base-uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/failures/base",
"event-type": "failures",
"summaries": [],
"time-updated": null
},
{
"base-uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/packet-retransmits/base",
"event-type": "packet-retransmits",
"summaries": [],
"time-updated": 1423675036
},
{
"base-uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/throughput/base",
"event-type": "throughput",
"summaries": [
{
"summary-type": "average",
"summary-window": "86400",
"time-updated": 1423675036,
"uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/throughput/averages/86400"
}
],
"time-updated": 1423675036
},
{
"base-uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/packet-retransmits-subintervals/base",
"event-type": "packet-retransmits-subintervals",
"summaries": [],
"time-updated": 1423675036
}
],
"input-destination": "wash-pt1.es.net",
"input-source": "128.143",
"ip-transport-protocol": "tcp",
"measurement-agent": "128.143.231.161",
"metadata-count-total": 1,
"metadata-key": "dfbd05cef48c4111b9da3cc1238f74ad",
"source": "128.143.",
"subject-type": "point-to-point",
"time-duration": "20",
"time-interval": "21600",
"tool-name": "bwctl/iperf3",
"uri": "/esmond/perfsonar/archive/dfbd05cef48c4111b9da3cc1238f74ad/"
}
]
and I want to retrieve the base-uri depending on the event-type.
I am writing a bash script to do that. I've never worked with JSON files or wrote python codes before, so I am sorry if my question seems so naive. Can I do this in Bash or it would be easier if I used python?
Thank you