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!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...