Forum Discussion

Dean_A's avatar
Dean_A
Icon for Neophyte rankNeophyte
16 days ago

REST Query no results

Hello,

I'm trying to do a simple query the rest service with a filter of system.hoststatus = normal using the following parameter:

systemProperties:"{'name':'system.hoststatus','value':'normal'}"

so my entire post string looks like this: 

https://me.logicmonitor.com/santaba/rest/device/devices?filter=systemProperties:"{'name':'system.hoststatus','value':'normal'}"

I'm getting a response, but its always empty:

{
  "status" : 200,
  "errmsg" : "OK",
  "data" : {
    "total" : 0,
    "items" : [ ],
    "searchId" : null,
    "isMin" : false
  }
}

Am I fundamentally mis-understanding the syntax for the query?

Thanks!

    • Dean_A's avatar
      Dean_A
      Icon for Neophyte rankNeophyte

      Sadly, the same result... i dont seem to be able to get any query to work

  • Oh I see, actually reading the url more :P I guess there is a new advanced filter thing I have not used. Sorry, haven't used it myself.

  • filter=systemProperties:"{\"name\":\"system.hoststatus\",\"value\":\"normal\"}"

     

  • Not using a fancy way I can make the call with it like this

    filter=hostStatus:"normal"
    
    
    curl --request GET \
      --url 'https://SUBDOMAIN.logicmonitor.com/santaba/rest/device/devices?size=1&filter=hostStatus%3A%22dead%22' \
      --header 'Authorization: Bearer lmb_BEARERTOKEN' \
      --header 'X-Version: 3'