Skip to main content
Solved

GraphQL Query

  • May 12, 2025
  • 5 replies
  • 0 views

Good afternoon,

I've been tasked with extracting performance data, for quarterly customer reviews, and after many hours of PowerBI M Query and trying to wrangle the data into a useable form - I still can't.
When I remembered that with GQL we can extract only what we need. 
However I've spent another few unsuccessful hours trying to find the connection between the devices and their performance data. 

This is as far I have I got:

query DeviceByOrgID {
  devices(search: {organization: {has: {id: {eq: "39"}}}}) {
    edges {
      node {
        id
        name
        ip
        componentChildren{edges{node {id}}}
        deviceClass {
          description
          class}
       }
    } 
  }
}

Could anyone show me how to extract some performance data for a device, CPU normalized hourly for example, using GQL?
Even if it's just for a single device.

Thanks

Best answer by miles_cross

Hi - You can try this.

query MyQuery {
  devices {
    edges {
      node {
        id
        ip
        name
        metrics(collection: {id: "cpu", duration: "2d", rollupFreq: hourly}) {
          info {
            label
            units {
              label
            }
          }
          values {
            edges {
              cursor
              node
            }
          }
        }
      }
    }
  }
}

5 replies

  • Answer
  • August 29, 2025

Hi - You can try this.

query MyQuery {
  devices {
    edges {
      node {
        id
        ip
        name
        metrics(collection: {id: "cpu", duration: "2d", rollupFreq: hourly}) {
          info {
            label
            units {
              label
            }
          }
          values {
            edges {
              cursor
              node
            }
          }
        }
      }
    }
  }
}


  • Author
  • August 29, 2025

Thanks, that was exactly what I was looking for.


  • September 11, 2025

hey so where/how do you run that gql interactively?


  • Author
  • September 12, 2025

Or the GQL Browser page (System > Tools > GQL Browser), built into SL1 versions 12.3.0 and later.


  • Author
  • September 12, 2025

And the docs for this are now on the SL Support Site (https://support.sciencelogic.com/s) under the Documentation drop down.