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 ...

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...