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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...