Splunk Dev

How to run a search and retrieve results in custom command

sarahh
Engager

Hi, I need to write a custom script that is in python which needs to access search results. What is the best way that I can utilize Splunk's search, get results, parse them and get access to the results from within my custom code?
Thanks alot.

0 Karma

LukeMurphey
Champion

Check out the eval and rename commands. These will you to make new fields and override the values of existing fields. No Python required.

If you do want to write a custom Search command, then check out these docs.

Edit - jonuwz And on the offchance you actually mean you need the SDK to connect to splunk, run a search then read the results - the SDK docs are here

0 Karma

LukeMurphey
Champion

@jonuwz: good point.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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