Getting Data In

REST API storage/collections/config return errors

yuanliu
SplunkTrust
SplunkTrust

I have a hard time getting examples in https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/kvstore/usetherestapitomanagekv/ to work.  One of the most obvious error is 405 with POST to storage/collections/config:

 

 

 

HTTP/1.1 405 Method Not Allowed
Date: Sun, 13 Jun 2021 16:27:53 GMT
Allow: GET,HEAD,OPTIONS
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Content-Length: 243
Connection: Keep-Alive
X-Frame-Options: SAMEORIGIN
Server: Splunkd

 

 

 

 

The documentation clearly says 

storage/collections/config
  • GET: Get a list of collections in a specific app.
  • POST: Create a new collection in a specific app.

GET method, meanwhile, always gets 404 page not found. Is there some permission to be set before API can enable POST and allow GET?

Labels (1)
0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @yuanliu 

Can you share the API endpoint that you are using and how you are testing it?

0 Karma

yuanliu
SplunkTrust
SplunkTrust

@venkatasri I use curl.  To test POST method, I use something like

curl -k -H 'Authorization Bearer <token>' \
    -d name=kvtest \    https://localhost:8089/servicesNS/myuser/search/storage/collections/config

nearly verbatim as in the document.  To test GET method,  just drop the -d option.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...