Hi, I am hoping to export the hostname, tags, and risk score associated with each of our assets. Do you have a query for this please?
This should get you what you’re looking for:
SELECT
da.host_name AS "Host Name",
fa.riskscore AS "Risk Score",
STRING_AGG(dt.tag_name,',') Tags
FROM fact_asset fa
JOIN dim_asset da ON fa.asset_id=da.asset_id
LEFT JOIN dim_tag_asset dat ON fa.asset_id=dat.asset_id
LEFT JOIN dim_tag dt ON dta.tag_id=dt.tag_id