Splunk Dev

How to get extracted fields when searching using the REST API ?

mlrhazi
New Member

When I search using the Python SDK, I don't seem to see any fields, other than the very basic ones like host, source, sourcetype... in the results. Is there a way to get the search to return all the same pre-extracted fields I get when using the splunk search GUI ? like fields automatically extracted by Splunk, such as those that come in field1=value1 ...etc?

Thanks,

Mohamed.

Labels (3)
0 Karma

soiram
Engager

rf=* for all fields

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @mlrhazi,

Splunk REST API does not extract fields like GUI. You should specify the required fields by rf (or required_fields on older versions) parameter. Please see the below documentation. 

https://docs.splunk.com/Documentation/Splunk/9.0.3/RESTTUT/RESTsearches#Tips_on_creating_searches

 

If this reply helps you an upvote and "Accept as Solution" is appreciated.
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 ...