Usage of jsonpath in BOA - Daniel-Brosnan-Blazquez/vboa GitHub Wiki
Introduction
This section of the SUM describes how to use jsonpath in BOA.
References
- Page of the library jsonpath-ng
- Page of an online jsonpath validator
Usage
This section describes some examples on how to use jsonpath to access data exported by EBOA.
- Import parser
from jsonpath_ng.ext import parse as jsonpath
- Access to root node:
jsonpath("$").find(data)
- Access to events node:
jsonpath("$.events").find(data)
- Access to events nodes which have a value with name "status" and value "MISSING":
jsonpath("$.events[?values[?name=='status' & value=='MISSING']] ").find(data)
- Get the duration in seconds of a timeline of events, filtered using jsonpath:
jsonpath("$.events[?values[?name=='status' & value=='MISSING']] ").find(dhus_product_completeness_l1_slc_events)|map(attribute="value")|get_timeline_duration_from_events_json