turbot / steampipe-plugin-net

Use SQL to instantly query DNS records, certificates and other network information. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/net
Apache License 2.0
23 stars 5 forks source link

Add example to extra data from a JSON response field #59

Open e-gineer opened 1 year ago

e-gineer commented 1 year ago

From this thread, an example like this would be good on the net_http_request table:

The trick is to cast the response into JSONB . For example:

> select response_body::jsonb ->> 'number' as num_people_in_space from net_http_request where url = 'http://api.open-notify.org/astros.json'

+---------------------+
| num_people_in_space |
+---------------------+
| 10                  |
+---------------------+