Splunk Search

Search ID or sid

teddyidc1101
Communicator

i have extracted this log as i need to get the search id to get the SPL used. this is a search that triggers an alert.

Audit:[timestamp=05-30-2018 01:26:40.497, user=splunk-system-user, action=search, info=granted REST: /search/jobs/rt_scheduler_asjkhasjfgalsjgasljf_search_asjkhasjfgalsjgasljf_at_1527059197_2.17][n/a]
Audit:[timestamp=05-30-2018 01:26:40.726, user=splunk-system-user, action=search, info=granted REST: /search/jobs/rt_scheduler_asjkhasjfgalsjgasljf_search_asjkhasjfgalsjgasljf_at_1527059197_2.18][n/a]

question: which part of the log is the search id or sid?
like if i use this code what will be the search id to be used from the audit event above?

 "index=_audit search_id='<your sid>'  info=granted | table search,savedsearch_name"

thanks!

0 Karma

niketn
Legend

@teddyidc1101, sids would be rt_scheduler_asjkhasjfgalsjgasljf__search__asjkhasjfgalsjgasljf_at_1527059197_2.17 and rt_scheduler_asjkhasjfgalsjgasljf__search__asjkhasjfgalsjgasljf_at_1527059197_2.18

However, if you want to pull details about the search id you should try either loadjob command or REST endpoint /services/search/jobs

|  loadjob "rt_scheduler_asjkhasjfgalsjgasljf__search__asjkhasjfgalsjgasljf_at_1527059197_2.18"

Or

|  rest /services/search/jobs/rt_scheduler_asjkhasjfgalsjgasljf__search__asjkhasjfgalsjgasljf_at_1527059197_2.18
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

teddyidc1101
Communicator

i tried both commands

|loadjob
Error in 'SearchOperator:loadjob': Cannot find job_id '“rt_scheduler_asjkhasjfgalsjgasljf_search_asjkhasjfgalsjgasljf_at_1527059197_2.18”'.
The search job has failed due to an error. You may be able view the job in the Job Inspector.

|rest /services/search/jobs/
Error in 'rest' command: Invalid argument: ‘rt_scheduler_asjkhasjfgalsjgasljf_search_asjkhasjfgalsjgasljf_at_1527059197_2.18'
The search job has failed due to an error. You may be able view the job in the Job Inspector.

0 Karma

niketn
Legend

@teddyidc1101 the job that you are trying to find has already expired!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

@teddyidc1101, if the answer/clarification satisfies your query please accept the answer 🙂

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Splunk Platform | Upgrading your Splunk Deployment to Python 3.9

Splunk initially announced the removal of Python 2 during the release of Splunk Enterprise 8.0.0, aiming to ...

From Product Design to User Insights: Boosting App Developer Identity on Splunkbase

co-authored by Yiyun Zhu & Dan Hosaka Engaging with the Community at .conf24 At .conf24, we revitalized the ...

Detect and Resolve Issues in a Kubernetes Environment

We’ve gone through common problems one can encounter in a Kubernetes environment, their impacts, and the ...