Splunk Search

use lookup or lookup-csv in custom python command

sbsbb
Builder

Is it possible to use a defined lookup, within a custom python command ?

If not, is it possible to access directly the csv file from the lookup, in order to process to a kind of lookup in the function ?

aelliott
Motivator

Lowell
Super Champion

Good question. I doubt it's possible to directly access a lookup from within a custom python search command. However, it should be possible to use the REST APIs to call back into splunk, get information about the location of a specific lookup file and then simply open it using Python's own csv module. This really only works for the simplest cases. For example, scripted lookups wont work. You'll have to implement any "extra" features that you need. (For example, a match_type of WILDCARD or CIDR).

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

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, ...