Im trying to automate some reports via the api, is it possible to get asset.agentkey is null value somewhere?

Thank you for the reply…, this is what i came up with but it not working…

    payload = {
{
        "asset": "tags IN ['OSSWIN']", 'asset.agentKey' : "IS NOT ['NULL']", 'os.vendor' : "CONTAINS ['Microsoft']",
        "vulnerability" : "vulnerability.categories NOT IN ['microsoft patch']"}

thank you man! i got it workin!

1 Like

So i put in a ticket for this, but wondering if you could help me,

i am trying to automate some reports, to calculate moderate, severe and critical vulnerability from each asset it returns.

it seems to work, but once it hits page 19/54 it seems to crap. out and throw an error message
i tried setting a 180 second (3 minute time out), but it still fails

‘metadata’: {‘number’: 19, ‘size’: 500, ‘totalResources’: 26511, ‘totalPages’: 54, ‘cursor’: ‘1542252837:::_S:::fec1d61c-6029-4ed4-a152-ef4111083cf6-default-asset-275429’}, ‘links’: [{‘href’: ‘https://us.api.insight.rapid7.com:443/vm/v4/integration/assets?page=0&size=500&sort=id,asc’, ‘rel’: ‘first’}, {‘href’: ‘https://us.api.insight.rapid7.com:443/vm/v4/integration/assets?page=18&size=500&sort=id,asc’, ‘rel’: ‘prev’}, {‘href’: ‘https://us.api.insight.rapid7.com:443/vm/v4/integration/assets?page=19&size=500&sort=id,asc’, ‘rel’: ‘self’}, {‘href’: ‘https://us.api.insight.rapid7.com:443/vm/v4/integration/assets?page=20&size=500&sort=id,asc&cursor=1542252837:::_S:::fec1d61c-6029-4ed4-a152-ef4111083cf6-default-asset-275429’, ‘rel’: ‘next’}, {‘href’: ‘https://us.api.insight.rapid7.com:443/vm/v4/integration/assets?page=53&size=500&sort=id,asc’, ‘rel’: ‘last’}]}
249
991
32
https://us.api.insight.rapid7.com/vm/v4/integration/assets?size=500&page=20
{’_type’: ‘com.rapid7.spring.rest.error.resource.ErrorResource’, ‘status’: 400, ‘localized_message’: None, ‘message’: ‘An unexpected error occurred. Please contact Rapid7 support.’, ‘throwable’: None}
Traceback (most recent call last):
File “rapid7_helper.py”, line 74, in
payload_data_for_kpi()
File “rapid7_helper.py”, line 69, in payload_data_for_kpi
desktop_3rd_party = get_kpi_group(params=payload_desktop_3rd_party)
File “rapid7_helper.py”, line 36, in get_kpi_group
for data in response1[‘data’]:
KeyError: ‘data’

Support is probably going to be your best option, that’s past what I can figure out for you. Also if you keep encountering issues it might be better to open a separate Topic since this one is already showing as solved. There may be someone else that could help troubleshoot this better than me.

1 Like

Hi,

So how do you filter more then 1 filter, i dont believe this is working and only capture my desktop support filter


    params = {
    "asset": "tags IN ['desktop_support']", 'os.vendor' : "CONTAINS ['Microsoft']", 'asset.agentKey' : "IS NOT ['NULL']", 
    "vulnerability" : "vulnerability.categories NOT IN ['microsoft patch']"}

I was able to figure it out by using the advanced option from the filer if anyone else gets stuck

1 Like