Hi !
I have a problem with a jsonpath expression. I have the following JSON:
{
"STATUS": [
{
"STATUS": "S",
"When": 1516116436,
"Code": 11,
"Msg": "Summary",
"Description": "sgminer 5.6.2-l"
}
],
"SUMMARY": [
{
"Elapsed": 12040,
"MHS av": 10140.4782,
"MHS 5s": 10131.6409,
"KHS av": 10140478,
"KHS 5s": 10131641,
"Found Blocks": 0,
"Getworks": 841,
"Accepted": 1479,
"Rejected": 9,
"Hardware Errors": 0,
"Utility": 7.3705,
"Discarded": 7674,
"Stale": 0,
"Get Failures": 0,
"Local Work": 48659,
"Remote Failures": 0,
"Network Blocks": 806,
"Total MH": 122090053.3249,
"Work Utility": 35953.2862,
"Difficulty Accepted": 7151707.47550726,
"Difficulty Rejected": 49736.50586112,
"Difficulty Stale": 0,
"Best Share": 4552945.973721,
"Device Hardware%": 0,
"Device Rejected%": 0.6894,
"Pool Rejected%": 0.6906,
"Pool Stale%": 0,
"Last getwork": 1516116435
}
],
"id": 1
}
The path I want to extract is “$.SUMMARY[0].Hardware Errors”. The issue is that I get an exception with that:
2018-01-16 15:28:09.251 [ERROR] [hab.binding.exec.handler.ExecHandler] - An exception occurred while transforming ‘{
“STATUS”: [
{
“STATUS”: “S”,
“When”: 1516116489,
“Code”: 11,
“Msg”: “Summary”,
“Description”: “sgminer 5.6.2-l”
}
],
“SUMMARY”: [
{
“Elapsed”: 12095,
“MHS av”: 10138.718,
“MHS 5s”: 10145.7327,
“KHS av”: 10138718,
“KHS 5s”: 10145733,
“Found Blocks”: 0,
“Getworks”: 843,
“Accepted”: 1482,
“Rejected”: 9,
“Hardware Errors”: 0,
“Utility”: 7.3517,
“Discarded”: 7705,
“Stale”: 0,
“Get Failures”: 0,
“Local Work”: 48854,
“Remote Failures”: 0,
“Network Blocks”: 808,
“Total MH”: 122628961.3825,
“Work Utility”: 35865.5606,
“Difficulty Accepted”: 7167126.50611462,
“Difficulty Rejected”: 49736.50586112,
“Difficulty Stale”: 0,
“Best Share”: 4552945.973721,
“Device Hardware%”: 0,
“Device Rejected%”: 0.6879,
“Pool Rejected%”: 0.6892,
“Pool Stale%”: 0,
“Last getwork”: 1516116489
}
],
“id”: 1
}’ with ‘JSONPATH($.SUMMARY[0].‘Hardware Errors’)’ : ‘An error occurred while transforming JSON expression.’
Anyone knows how I could fix this as an online jsonpath tester showed the correct results ?