Splunk Search

[SPLUNKD] Not Found for lookup REST api call

sumangala
Path Finder

Hi Splunkers,

I have a curl for changing ownership of lookup file present app level to user level by this curl
curl -k -u admin:password https://localhost:8089/servicesNS/*new user*/*app name*/data/lookup-table-files/lookup_file.csv/acl -d owner=*new user* -d sharing=user

This curl works fine and changes ownership to new user. I have written REST api for this curl in Javascript.
var service = mvc.createService({ owner: form_uid });
var record = {
"owner": form_uid,
"sharing": "user"
};
service.request(
"data/lookup-table-files/lookup_file.csv/acl",
"POST",
null,
null,
JSON.stringify(record),
{"Content-Type": "application/json"},
null).done(function() {
alert("pass");
});

Here form_uid is new user value. After executing this I am getting 404 (Not found) and mvc.js:6 [SPLUNKD] Not Found
With curl I could able to access REST api and result also works. But, with rest api call its not working.
I searched all possible answers from this portal. Can anyone help me to resolve this?

Thank you.

0 Karma
1 Solution

sumangala
Path Finder

A problem is resolved for [SPLUNKD] Not Found error for Splunk rest API access for ACL:
A splunkd endpoint resides on port 8089 by default. In order to access these from code running in Javascript in the context of the browser, it needs to be “expose” setting in $SPLUNK_HOME/etc/system/default/web.conf for below 3 sets of lookup table rest api.

```[expose:data_lookup-table-files]
methods = POST,GET
pattern = data/lookup-table-files

[expose:data_lookup-table-files_ELEMENT]
methods = GET,DELETE,POST
pattern = data/lookup-table-files/*

[expose:data_lookup-table-files_ELEMENT_acl]
methods = POST
pattern = data/lookup-table-files/*/acl
```

View solution in original post

0 Karma

sumangala
Path Finder

A problem is resolved for [SPLUNKD] Not Found error for Splunk rest API access for ACL:
A splunkd endpoint resides on port 8089 by default. In order to access these from code running in Javascript in the context of the browser, it needs to be “expose” setting in $SPLUNK_HOME/etc/system/default/web.conf for below 3 sets of lookup table rest api.

```[expose:data_lookup-table-files]
methods = POST,GET
pattern = data/lookup-table-files

[expose:data_lookup-table-files_ELEMENT]
methods = GET,DELETE,POST
pattern = data/lookup-table-files/*

[expose:data_lookup-table-files_ELEMENT_acl]
methods = POST
pattern = data/lookup-table-files/*/acl
```

0 Karma

jkat54
SplunkTrust
SplunkTrust

You have to add https://localhost:8089/servicesNS/newUser/AppName to the service.request code.

0 Karma

sumangala
Path Finder

In REST api call, if I just mention URL after app name. It generates URL exactly same as curl URL. after executing I can see URL on console is same as curl url. When [SPLUNKD] Not Found error comes?
when required splunk api not present in splunkd. If so it works fine when I run curl.

0 Karma

jkat54
SplunkTrust
SplunkTrust

404 means the URL is invalid, Fix the URL to solve the problem.

Remember that urls are case sensitive too.

0 Karma

sumangala
Path Finder

URL is correct. Its same as curl URL. Curl works. Why not same URL in REST api is giving [SPLUNKD] Not Found?

0 Karma

jkat54
SplunkTrust
SplunkTrust

This:
"data/lookup-table-files/lookup_file.csv/acl"

Is not the same as this:

https://localhost:8089/servicesNS/*new user*/app name/data/lookup-table-files/lookup_file.csv/acl

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...