Splunk Enterprise

How to get the search query from a search sid using restful API?

patng_nw
Communicator

I have a search SID, and currently I am getting its result using the API api/search/jobs/<sid>/results

However, I also need to access the search query string behind this search result.  Is there an API for getting that?

Labels (1)
0 Karma
1 Solution

493669
Super Champion

Hi @patng_nw 

Use below spl query and add necessary sid then request.search will provide the required search query string

| rest /services/search/jobs/<sid>| table sid title eai:acl.app eai:acl.owner request.search

 


-----------------------------------------------------------------------------------------------------------------------------------
If this reply helps do upvote the answer.

View solution in original post

0 Karma

493669
Super Champion

Hi @patng_nw 

Use below spl query and add necessary sid then request.search will provide the required search query string

| rest /services/search/jobs/<sid>| table sid title eai:acl.app eai:acl.owner request.search

 


-----------------------------------------------------------------------------------------------------------------------------------
If this reply helps do upvote the answer.

0 Karma

patng_nw
Communicator

It works.  Thanks a lot!

0 Karma
Get Updates on the Splunk Community!

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

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...