skip to Main Content

Json – Whole word matches in jq

Running the below: $ echo '["lorem", "ipsum", "dolor"]' | jq '. | contains(["rem"])' returns true because "rem" is a substring of "lorem". I would like a whole word match, which would disqualify "rem" and only allow one of the three…

VIEW QUESTION

Convert json to Markdown Table in bash

I am trying to convert the below json to a markdown table(GitHub docs(.md file)), however not able to do so. { "service_1":"abc-endpoint.vpce.amazonaws.com", "service_2":"def-endpoint.vpce.amazonaws.com", "service_3":"xyz-endpoint.vpce.amazonaws.com" } Command I tried: cat json_file | jq -r '{"NAME": "ENDPOINT_ID"} + . | to_entries[] |…

VIEW QUESTION

reformat json output with jq

My input data looks like this { "objects": [ { "statistics": [ { "dataType": 0, "value": 0.0, "id": 18 }, { "dataType": 1, "value": 0, "id": 89 }, { "dataType": 0, "value": 35.0, "id": 91 }, { "dataType": 0, "value":…

VIEW QUESTION
Back To Top
Search