I am using this app for querying database (Sql server logs). I have completed all the steps in read.txt file provided in app directory but I get "Error: Could not find or load main class lib\sqljdbc.jar". Indexer is on Windows machine.
How can I solve this error?
Thanks.
I have SPLUNK_HOME set, however I am still getting this error
I did not duplicate this on Windows, but on OS X I received the linux comparable error. Setting the SPLUNK_HOME variable fixed this.
Error: Could not find or load main class com.splunk.jdbcscriptedinput.Main
i am having a similar issue
Ok, I dont see anything wrong with your stanza, but i think i know whats happening. To be sure you mind posting your bat script ommitting anything confidental. Here is my though in your bat file you need to fully quilify your paths for both java and your jar file or add ENV variables for each.
Example of a commandline jar I use.
d:/java/jdk1.6.0_31/bin/java.exe -jar d:/mycustomjars/cmdline-jmxclient-0.10.5.jar
#note: if there are any spaces in your paths single or double quote them.
Should I share query.propertues and query.properties.mssql file contents?
Thanks.
I've installed JDK 7u9 with no problems on a win2k8 server with splunk 4.3.x. I am unable to replicate your issues. Not sure what the minimium JRE requirements are for this app. Also make sure you have correctly defined your query.properties and query.properties.mssql.
The file says : Error: Could not find or load main class com.splunk.jdbcscriptedinput.Main
Thanks.
I'm reaching my limit of knowledge here but post your $SPLUNK_HOME/var/log/splunk/jdbcscriptedinput.yourqueryname.log
No luck. If you need any other information, please let me know. I have done everything accoerding to your instructions.
java -cp "lib*" com.splunk.jdbcscriptedinput.Main %QUERY_NAME%\query.properties %QUERY_NAME%\query.pointer 2> %LOG_PATH%
Do I need to change %QUERY_NAME% information in this command.
Thanks.
Not this particular error, I work with Java/JVMs in a mixed environments. Its usually path or missing lib issue when working with CLI.
Yeah.It changed. Now it is able to find the JAR ( I guess). Have you face this error before?
Thanks.
The error changed? If thats the case copy the splunkjdbcscriptedinput-0.3.jar and log4j-1.2.16.jar from $SPLUNK_HOME/etc/apps/splunkjdbcscriptedinput/bin/lib/ to your new location.
Thanks. The error is "Could not find or load main class com.splunk.jdbcscriptedinput.Main"
Ok, Have you placed your libsqljdbc.jar in $SPLUNK_HOME/etc/apps/splunkjdbcscriptedinput/bin/lib/. All jar(s) for youjdbc driver have to be placed in that location or edit the script to reference you jar locations.
Line 14 of the bat file java -cp "lib\*" change lib to the location of your jdbc driver .jar location.
Thanks for help. I am using the same bat file with as given by the app. Here are the contents.
@echo off
cd %~dp0
SET QUERY_NAME=%1
SET LOG_NAME=jdbcscriptedinput.%QUERY_NAME%.log
SET LOG_PATH="........\var\log\splunk\%LOG_NAME%"
del %LOG_PATH%.5
rename %LOG_PATH%.4 %LOG_NAME%.5
rename %LOG_PATH%.3 %LOG_NAME%.4
rename %LOG_PATH%.2 %LOG_NAME%.3
rename %LOG_PATH%.1 %LOG_NAME%.2
rename %LOG_PATH% %LOG_NAME%.1
java -cp "lib*" com.splunk.jdbcscriptedinput.Main %QUERY_NAME%\query.properties %QUERY_NAME%\query.pointer 2> %LOG_PATH%
Thanks.
According to the app, I need to create one inputs.conf file. The stanza is :
[script://./bin/run.bat example]
interval = 60
sourcetype = example
source = jdbc
Thanks.
Could you provide your stanza for your scripted input?