# Request for specific assets from old report scan

**URL:** <https://discuss.rapid7.com/t/request-for-specific-assets-from-old-report-scan/36184>\
**Category:** SQL Queries\
**Tags:** InsightVM, sql, vulnerability-management, queries\
**Created:** [April 19, 2024, 1:20pm UTC](https://discuss.rapid7.com/t/request-for-specific-assets-from-old-report-scan/36184 "2024-04-19T13:20:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfrye](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/j/74df32/32.png) [@jfrye](https://discuss.rapid7.com/u/jfrye)\
**Post date:** [April 19, 2024, 1:20pm UTC](https://discuss.rapid7.com/t/request-for-specific-assets-from-old-report-scan/36184/1 "2024-04-19T13:20:53Z")

</div>

Hello, the below sql query is the closest I can find for our use case. Basically I would like to pull out a couple assets for a client to see their results without showing other clients. The issue is from the scope from under reports doesn’t give an option for certain assets, and cannot work vice versa in the remote site in which pulls the recent scans. In this case I need to pull from an older scan to show that the assets had no vulnerabilities from a point in time.

SELECT  
da.ip\_address,  
fa.asset\_id as id,  
fa.critical\_vulnerabilities,  
fa.severe\_vulnerabilities,  
fa.moderate\_vulnerabilities,  
fa.vulnerabilities as total\_vulnerabilities,  
da.host\_name  
FROM  
fact\_asset fa  
JOIN dim\_asset da USING (asset\_id)

---

<div class="post-metadata">

**Author:** ![talford](https://discuss.rapid7.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@talford](https://discuss.rapid7.com/u/talford)\
**Post date:** [April 23, 2024, 11:40am UTC](https://discuss.rapid7.com/t/request-for-specific-assets-from-old-report-scan/36184/2 "2024-04-23T11:40:52Z")

</div>

I’m not sure I understand your comment ‘and cannot work vice versa in the remote site in which pulls the recent scans’, so ignoring that for now…

There are a couple of options I can think of to get specific assets. Which you choose really depends on if this is a one-off request or something you need to repeat.

If it’s just a one-off you can add a line to your existing query that says WHERE da.host\_name = ‘abcd’ or da.host\_name = ‘efgh’. (or use IP address instead of hostname as required). If there are more than a couple assets you might want to look at using IN instead of =.

If this needs to be repeatable then you could create a tag with a name that makes sense to you, like ‘ClientA\_report’ then assign that tag to the assets required. Then create an Asset Group with a dynamic criteria of ‘User-added custom tag’ IS, and then pick your tag from the dropdown. Then you can use that asset group in the criteria in the report. To rerun the reports with different assets you would then just unassign and reassign tags without needing to edit the report criteria or SQL.
