# 3.1.1 Group FileWave Report Data with Prometheus

## What this does

Prometheus can aggregate fields from a FileWave Inventory Report so Grafana can display rollout counts, client-version summaries, and other grouped results.

## When to use it

Create a custom Prometheus scrape job when a Grafana panel needs a count grouped by a field in an existing Inventory Report.

<p class="callout info">This workflow requires file-system access to a self-managed FileWave Server. Hosted FileWave customers should contact FileWave Technical Support for server-side configuration changes.</p>

## Configuration location

Save custom YAML jobs in `/usr/local/etc/filewave/prometheus/conf.d/jobs/https` on the FileWave Server. Prometheus reads jobs from this directory automatically. Sample jobs are available in `/usr/local/etc/filewave/prometheus/conf.d/jobs`.

Copy the closest sample and edit it carefully. YAML indentation is significant, and the report must include every field used for counting or grouping.

<table id="bkmrk-%C2%A0-%C2%A0-step-example-1.-"><thead><tr><th> </th><th> </th></tr></thead><tbody><tr><td>Step</td><td>Example</td></tr><tr><td>1. Copy a sample YAML file into `/usr/local/etc/filewave/prometheus/conf.d/jobs/https` and give it a meaningful name.</td><td>![image2020-8-11_13-31-54.png](https://kb.filewave.com/uploads/images/gallery/2023-07/e4kS94SKs3qxXpmV-image2020-8-11-13-31-54.png)</td></tr><tr><td>2. Choose three values for the job:- The Inventory Report to read.
- The field to count. `device_id` is a common choice when counting devices.
- The field to group by, such as FileWave Client version.

</td><td> </td></tr><tr><td>3. Open the Inventory Report and note its report ID. Confirm that the report includes the count field and the field you will group by.</td><td>![Report YML Config.png](https://kb.filewave.com/uploads/images/gallery/2023-07/F35g36Iot5EL6xEh-report-yml-config.png)</td></tr><tr><td>4. Get the definition for the fields you want to use from the API...the easiest way is to do a curl from the command line like this:   
  
`bash<br>curl -s -k -H "Authorization: <Base64_API_Token>" https://<my.server.address>:20445/inv/api/v1/query/<report_id> | python -mjson.tool<br>`  
  
Make sure and substitute in your values for the &lt;Base64\_API\_Token&gt;, &lt;my.server.address&gt; and &lt;report\_id&gt;  
  
You'll get a response that includes the component and the field names as shown at right</td><td>![image2020-8-11_14-43-10.png](https://kb.filewave.com/uploads/images/gallery/2023-07/cigapWuESXaaVaFj-image2020-8-11-14-43-10.png)</td></tr><tr><td>5. Edit the YAML job with the report ID, count field, and grouping field, then save it. When starting from the sample, remove the leading `#` only from the lines you intend to enable.</td><td>![image2020-8-11_14-50-19.png](https://kb.filewave.com/uploads/images/gallery/2023-07/yJhig0WZ1YeFgvDx-image2020-8-11-14-50-19.png)</td></tr></tbody></table>

Allow a minute or two for Prometheus to read the job, then confirm that the new metric is available before building the Grafana panel.