Getting Data In

Why does a search with inputlookup work when used in Splunk Web, but returns no results when using the REST API?

mohankesireddy
Path Finder

"inputlookup" command works fine when I use in Splunk UI, but same search comes back with no results when I search through REST API:

curl -w "@curl-format.txt" -s -k -u admin:changes  https://localhost:8089/servicesNS/admin/search/search/jobs -d search="| inputlookup lookupdefinition” -d output_mode=json
Tags (2)
0 Karma
1 Solution

mohankesireddy
Path Finder

found the issue, its not the issue with REST API but permissions. the lookup permissions are constrained to an app context and the REST search using a different app context.

# curl -ku user:support https://localhost:8089/servicesNS/admin/search/search/jobs/export -d search="| inputlookup ip2internalhostname" -d output_mode=json
{"preview":false,"offset":0,"lastrow":true,"result":{"hostname":"big","src":"0.0.0.0"}}

View solution in original post

mohankesireddy
Path Finder

found the issue, its not the issue with REST API but permissions. the lookup permissions are constrained to an app context and the REST search using a different app context.

# curl -ku user:support https://localhost:8089/servicesNS/admin/search/search/jobs/export -d search="| inputlookup ip2internalhostname" -d output_mode=json
{"preview":false,"offset":0,"lastrow":true,"result":{"hostname":"big","src":"0.0.0.0"}}
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...