Splunk Search

How to get ID of splunkd process executing saved search?

YuriSpirin
Explorer

Hello!

I'm trying to resolve issues with splunkd being killed by OOM Reaper and it would be nice to know which saved search (or ad-hoc search) is consuming too much RAM. In Linux messages from Search Head I have a PIDs of reaped splunkd processes and the question is how to get PID of splunkd for particular saved search from _internal index. Scheduler events have SID field like this:

sid="scheduler_aS5zLnNva29sb3Y_czdfc2llbV9uZXR3b3Jr__RMD58313482a27867d57_at_1716903900_27923"

Is the last part of SID (27923) a Linux process ID? Or maybe I can get PID from some other source?

Labels (1)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

If you already know the search ID, it shouldn't matter whether it is saved search or not.

| rest /services/search/jobs/<search ID>
| fields sid pid

Here, pid is the process ID.  There are tons of other output from this call.

If you only know the saved search's name, you can search by label

| rest /services/search/jobs
| where isSavedSearch == 1 AND label = "<your report name>"
| fields label sid pid

Hope this helps.

View solution in original post

Tags (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

If you already know the search ID, it shouldn't matter whether it is saved search or not.

| rest /services/search/jobs/<search ID>
| fields sid pid

Here, pid is the process ID.  There are tons of other output from this call.

If you only know the saved search's name, you can search by label

| rest /services/search/jobs
| where isSavedSearch == 1 AND label = "<your report name>"
| fields label sid pid

Hope this helps.

Tags (1)
0 Karma

YuriSpirin
Explorer

Thanks, that was helpful!

0 Karma
Get Updates on the Splunk Community!

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...