Getting Data In

Splunk Metric Catalog REST API not returning data

New Member


Im a beginner in Splunk. For an integration, Im trying to access the metric data available in Splunk using REST API.

when I try the below mentioned URI im not getting any data returned (Just getting a link to the acl)


Im authorizing as a user with list_metrics_catalog capability. Please find the acl permissions for the specified REST URL in my instance below,

app- system
owner - nobody
read - *
write  - admin

Using mstats , im able to view the metric data in SPlunk UI but I want to access it through REST API.

Please help.

0 Karma

Splunk Employee
Splunk Employee

Hi nkarthick2511!

What index is the data in?

Just be sure that the user making the rest call has access to the indexes where the data resides, or use a filter that looks for the proper indexes in the api call

If no metric indexes are defined with
the filter parameter, Metrics Catalog
endpoints use the default indexes
specified for the role of the user. To
review or update the default indexes
for specific roles, select Settings >
Access controls > Roles, select a
role, and review or update the Indexes
searched by default field.

FWIW, Here's how I have been playing with the API lately.

First, I am working from my Splunk cli with curl and jq installed on Linux and am calling splunkd on localhostwith my admin account. If you curl with your admin account, do you see the metrics listed?

I'll curl with silent -s and insecure -k with my splunk credentials -u admin:password and output as json ?"output_mode=json", then stuff it through jq to just get the metric_name from the json payload. See API docs for more

curl -sk -u admin:helloworld https://localhost:8089/services/catalog/metricstore/metrics?"output_mode=json"; | jq .entry[].name

I find this preferable to messing with xml but check the API Reference because not all endpoints support all encoding, as this command will require you to have to parse the returned xml for the entity.title tags, although I am sure there are ways out there to handle that, like I did they json with jq:

...truncated for brevity
    <link href="/services/catalog/metricstore/metrics/kube.cluster.cpu.request" rel="alternate"/>
    <link href="/services/catalog/metricstore/metrics/kube.cluster.cpu.request" rel="list"/>
    <content type="text/xml">
        <s:key name="eai:acl">
            <s:key name="app"></s:key>
            <s:key name="can_list">1</s:key>
            <s:key name="can_write">1</s:key>
            <s:key name="modifiable">0</s:key>
            <s:key name="owner">system</s:key>
            <s:key name="perms">
                <s:key name="read">
                <s:key name="write">
            <s:key name="removable">0</s:key>
            <s:key name="sharing">system</s:key>
...truncated for brevity

Hopefully this is useful. Let me know how if you figure it out!

0 Karma

New Member

Thanks for the response.
Im trying to develop a java script script to access the splunk metrics and load it into ServiceNow for analysis. For that as a first step im using a HTTP tool like POSTMAN and trying to get the results.

Is there anything I need to change in the URL if im not using CURL.

I want to see the results decide the parameters need to be passed and then jump on to script development.

0 Karma