使用psql连接本地Steampipe服务时,net_http_request关系不存在如何解决?
解决
net_http_request关系不存在的问题 net_http_request不是Steampipe默认自带的表,它属于Steampipe的net插件,需要手动安装这个插件才能使用。
步骤1:安装net插件
在终端执行Steampipe的插件安装命令:
steampipe plugin install net
步骤2:修正查询语句
安装完成后,重新连接Steampipe的Postgres服务(或重启Steampipe),此时需要用插件名作为前缀引用该表,修正后的查询代码如下:
select r->>'full_name' as repository_full_name, r->>'default_branch' as default_branch from net.net_http_request, jsonb_array_elements(response_body::jsonb) as r where url = 'https://api.github.com/orgs/MY_GITHUB_ORG/repos?per_page=100&sort=full_name'
额外排查点
如果安装后仍报错,执行steampipe plugin list查看net插件状态,若未启用,再执行steampipe plugin enable net手动启用。
内容的提问来源于stack exchange,提问作者Cornelius Roemer
相关产品推荐
相关产品推荐

