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!

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...

Splunk Answers Content Calendar, June Edition II

Get ready to dive into Splunk Dashboard panels this week! We'll be tackling common questions around ...

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...