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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...