Splunk Dev

is it possible to call java(JVM) in a batch script for alter action?

fredzhang
New Member

I want to build a batch script which can call java command to start a JVM process to process the search result. I have tried that in "echo.bat" but nothing happened after the batch invoked.

Anyone know how to do that?

Thanks

Tags (2)
0 Karma

gkanapathy
Splunk Employee
Splunk Employee

Yes you can, but you almost certainly will have to set the environment properly for any java command to run.

0 Karma

fredzhang
New Member

yes, The java is in the path so that I can run it any directory.

0 Karma

Damien_Dallimor
Ultra Champion

Is "java" in the environment PATH for the user that you are running Splunk as ?

0 Karma

fredzhang
New Member

yes, I have done all the settings and I can run the batch file manually in command line. But when I try to trigger the batch alert in a schedule search, only the "echo" command executed and "java" command did not.

0 Karma
Get Updates on the Splunk Community!

Good Sourcetype Naming

When it comes to getting data in, one of the earliest decisions made is what to use as a sourcetype. Often, ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Splunk App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...