Reporting

Is it possible to do a search as a background job and webhook to my API when it completes?

AkhilKrishnaA
New Member

Hi,
I am trying to automate a Splunk search and export the result to our database. Is it possible to do a search as a background job and webhook it to my API when it completes?

0 Karma

renjith_nair
Legend

@AkhilKrishnaA,

You could create a scheduled alert and set webhook in the alert actions

https://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Alert/Definescheduledalerts

http://docs.splunk.com/Documentation/Splunk/7.1.2/Alert/Webhooks

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

AkhilKrishnaA
New Member

But which condition can I check to trigger webhook. On which index can I check the status of job.

0 Karma

renjith_nair
Legend

Splunk sends the alert once the search is completed. So you could set the trigger condition based on your requirements , for e.g. "number of results" greater than 0 or number of hosts or even some custom conditions . Please see : http://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Alert/AlertTriggerConditions#Workflow_for_tri...

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

AkhilKrishnaA
New Member

which Index should I check? Is it possible to create an alert using Java SDK?

0 Karma

renjith_nair
Legend

@AkhilKrishnaA, you search your normal data index and then set it as a scheduled search and port the results to your database.

Please refer to these documents : https://docs.splunk.com/Documentation/SplunkCloud/7.0.3/Alert/Definescheduledalerts

http://docs.splunk.com/Documentation/Splunk/7.1.2/Alert/Webhooks

Java SDK : http://dev.splunk.com/view/java-sdk/SP-CAAAEKY

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...