Splunk Search

can i run curl command in the search head

Nadhiyaa
Path Finder

can i run curl command in the search head to access the rest api logs

Tags (1)
0 Karma

PowerPacked
Builder

Hi @Nadhiyaa

Yes, you can run the Curl Command on Search Head,

CURL is a linux or Unix command which performs Get/Post/Delete Operations on given Endpoints, in our case Splunk end points.

For Example:
Curl -k -u admin:password https://SearchHead_host:8089/servicesNS/admin/search/search/jobs/export -d search=“search index=_internal | head 3” -d output_mode=csv/xml/json

when you execute the above the curl request on the search head, you will get the results of the above search exported into csv/xml/json files.

you can do a lot with splunk end points, to start with look these docs.
http://docs.splunk.com/Documentation/Splunk/7.1.2/RESTREF/RESTprolog

Thanks.

Thanks

0 Karma

richgalloway
SplunkTrust
SplunkTrust

It's not clear what you want to accomplish. You can make Splunk REST API calls directly in the search window using the rest command. For other REST APIs, use the REST API Modular Input app (https://splunkbase.splunk.com/app/1546/).

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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