Monitoring Splunk

SignalFX API to sum metrics

AleksandarT
New Member

We are using SignalFX to publish metrics to it and all looks good so far. We have a client that wants to use the SignalFX API itself in order to query timeseries window data to get some data.
The query that we have written returns the metrics for each HOST (sum per minute). Based on the documentation here (https://dev.splunk.com/observability/reference/api/retrieve_timeserieswindow/latest) i dont see any way of how a sum could be achieved (instead of per host results).
Theoretically i could just iterate over the object keys and sum up the results, but it would be better if this is returned out of the box.
Here is the curl command i am using to retrieve the data
```
curl --request GET \
--url '${DOMAIN}/v1/timeserieswindow?startMS=1623943080000&endMS=1623943140000&query=sf_metric%3Ainsert%20AND%20App%3Aservices-cloud%20AND%20Environment%3Abeta&resolution=60000' \
--header 'X-SF-token: ${TOKEN}'
```
The response that i am getting is
```
{
"data": {
"E4EXtGzAgAA": [
[
1623943140000,
4.0
]
],
"E4E22smAYAA": [
[
1623943140000,
10.0
]
]
},
"errors": [
]
}
```
where `E4EXtGzAgAA` and `E4E22smAYAA` are host ID's. I would like to have only the value 14 in the response.
Any way to achieve this?
Thanks a lot

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...