dtja73027 2016-06-05 02:03
浏览 98

Newrelic:按ID过滤rest / json API请求

I'm working on a custom dashboard, and I want to pull specific information from some of our monitoring tools. We use new relic, and I would like to show the response time of one of our applications on our dashboard. Using New Relics API explorer I got this:

 curl -X GET 'https://api.newrelic.com/v2/applications.json' \
 -H 'X-Api-Key:myapikey' -i \
 -G -d 'filter[ids]=1739407' 

I'm still learning the ins and outs of all this, and got this:

$ch = curl_init('https://api.newrelic.com/v2/applications.json');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Api-Key:myqpikey']);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
if (curl_errno($ch)) {
    print "Error: " . curl_error($ch);
}
curl_close($ch);

So this, of course, echoes all applications. What I would like to know is given the curl command above from the new relic explorer, how would I filter by that ID? If someone is more versed in New Relic and knows a better way to accomplish this, I'm open for suggestions.

  • 写回答

1条回答 默认 最新

  • drt41563 2016-06-07 14:36
    关注

    So I figured out. It was overly obvious, and shamefully I missed it. Hopefully by posting the answer others will not feel the shame I felt.

        https://api.newrelic.com/v2/applications.json?filter[ids]=1739407
    
    评论

报告相同问题?

悬赏问题

  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表