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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...