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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...