→ 🚀Are you a Lansweeper Champion?! Join our Contributor Program Sign up here!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lwhofmann
Engaged Sweeper

I currently have multiple reports in Classic that I use to show specific software packages that not installed, for example, All Computers Missing Rapid 7 Insight Agent. I am trying to recreate those reports in Lansweeper Cloud (Sites?) so that I can retrieve the results of the reports via API rather than having to manually export the reports every time I need the data. Can anyone out here help me with getting a report going? I have spent around 8-10 hours working on this with no valid results.

Thank you in advance!

2 REPLIES 2
lwhofmann
Engaged Sweeper

Thanks @DavidPK. I have watched that video a couple of times, and it helps some, but hasn't quite gotten me "across the finish line".

I have successfully created the report that I am wanting, with one exception...I am trying to filter out any assets that were last seen over 31 days ago. I can do it for a specific date, but I want it to "roll" based on the day that the report is run/viewed. So, at this point I am looking for some help with the custom filter that I would need to write.

The code for the "default" filter that I have working is:

{
  "$or": [
    {
      "Last Seen": {
        "$gtDate": "2024-12-29"
      }
    }
  ]
}

and I could really use some assistance getting it to be dynamic. ChatGPT has suggested that I use the following:

{
  "$match": {
    "Last Seen": {
      "$gte": {
        "$dateSubtract": {
          "startDate": "$$NOW",
          "unit": "day",
          "amount": 31
        }
      },
      "$lte": "$$NOW"
    }
  }
}

and I cannot save it because I get the following error: "One or more steps in the report contains errors. Please fix them before saving changes."

Thank you

DavidPK
Lansweeper Tech Support
Lansweeper Tech Support

Hi 

 

Here is some information that could help you achieve your goal. 

 

https://community.lansweeper.com/t5/pro-tips/pro-tips-40-chatgpt-amp-advanced-reporting-in-cloud/ba-...