Splunk Search

Splunklib API retrieve inputlookup

Tim00
Explorer

Hi all,

have been using the splunklib package in Python to connect to the Splunk API for some time now, and it works fine. As sample search I use is provided below:

searchquery = """search index=wineventlog EventCode=4688 earliest=-4h | fields user, ETC, ETC, ETC
| table user, ETC, ETC, ETC"""
resolveQuery = SplunkQuery(host, port, username, password)
df = resolveQuery.splunk_fetch(searchquery)

The search return a pandas dataframe (in Python) containing the required information.

When I try to retrieve an inputlookup however, the search doesn't return any information, only an empty dataframe.  Below is an example of a searchquery I use to try and retrieve an inputlookup:

searchquery = """search | inputlookup infomation.csv"""

Any help would be highly appreciated: how can I retrieve inputlookups using the Splunklib package in Python?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The inputlookup command is supposed to be the first command in a query.  Try this:

searchquery = """| inputlookup infomation.csv"""

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

Tim00
Explorer

Thanks for your help

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The inputlookup command is supposed to be the first command in a query.  Try this:

searchquery = """| inputlookup infomation.csv"""

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...