<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Java app with Splunk - Commands, scripts or modular inputs? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174029#M16745</link>
    <description>&lt;P&gt;Can you provide some details about the data source you are trying to get into Splunk ? Log files ? In flight App data ? Data from some API ? &lt;/P&gt;

&lt;P&gt;The experts on this forum will then be able to advise of the best way to get this data into Splunk.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Aug 2014 09:33:40 GMT</pubDate>
    <dc:creator>Damien_Dallimor</dc:creator>
    <dc:date>2014-08-08T09:33:40Z</dc:date>
    <item>
      <title>Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174025#M16741</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I've been having difficulty trying to set up Splunk to use a simple Java app I have created to feed data into Splunk from multiple Windows (x86 and x86_64) servers. The app itself is rather straightforward so it's not worth talking that much about excluding its execution, which includes one parameter:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;java -jar SplunkTest.jar start&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I've been reading up on modular inputs (&lt;A href="http://dev.splunk.com/view/java-sdk/SP-CAAAER2"&gt;Howto&lt;/A&gt;, &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/AdvancedDev/ModInputsSpec"&gt;ModInputsSpec&lt;/A&gt; &amp;amp; &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModInputsExample"&gt;ModInputsExample&lt;/A&gt;) which sound like it could be the solution to my problem, but it doesn't appear to be straightforward how to do this. For example, I'm not sure where the application is invoked from, nor how I would set the interval.&lt;/P&gt;

&lt;P&gt;Using commands.conf seems promising as well, but the examples are only for perl/python. I would prefer not to use a python wrapper to invoke a java application, but this could work as well. Scripts I guess fall under a similar category.&lt;/P&gt;

&lt;P&gt;I've tried to set up my installation as per the first howto link above, but I'm still at a bit of a loss. It currently looks like this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;default/&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; app.conf&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; inputs.conf (empty)&lt;BR /&gt;&lt;BR /&gt;
jars/&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; SplunkTest.jar&lt;BR /&gt;&lt;BR /&gt;
local/&lt;BR /&gt;&lt;BR /&gt;
metadata/&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; default.meta&lt;BR /&gt;&lt;BR /&gt;
windows_x86/bin/&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; SplunkTest.exe (renamed from shim-windows_x86.exe)&lt;BR /&gt;&lt;BR /&gt;
windows_x86_64/bin/&lt;BR /&gt;&lt;BR /&gt;
-&amp;gt; SplunkTest.exe (renamed from shim-windows_x86_64.exe)&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Has anyone else tried to do this or has a successful implementation of similar? &lt;A href="https://github.com/damiendallimore/SplunkModularInputsJavaFramework"&gt;This framework&lt;/A&gt;, for example, served just to confuse me more than help me.&lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated!!&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;
Alex&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 09:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174025#M16741</guid>
      <dc:creator>alekksi</dc:creator>
      <dc:date>2014-08-07T09:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174026#M16742</link>
      <description>&lt;P&gt;You have a couple of options. It seems you want to get logs from some sort of homegrown Java app into Splunk. Could you not write the relevant output to a standard log file then send it to Splunk using universal forwarder? Is that an option for you? You could have SplunkTest.jar log to output.txt using out.println or whatever, then have an app set up that monitors the directory containing the log file.&lt;/P&gt;

&lt;P&gt;Apart from that you could also consider using a wrapper script to invoke your application. I know it could seem a bit wrong but I have successfully done this in the past.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Aug 2014 20:31:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174026#M16742</guid>
      <dc:creator>derekarnold</dc:creator>
      <dc:date>2014-08-07T20:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174027#M16743</link>
      <description>&lt;P&gt;No, unfortunately not. This SplunkTest app is just to check that I can invoke Java apps using Splunk. The actual end-goal is to use my own PerfMon:// csv files with my own specifications, as I've found the Splunk for Windows Infrastructure app massively lacking, by which I mean it accounts for a third of all our total data usage, when it is only monitoring a small number of servers, in comparison to our Linux stats. The Java app I have written basically keeps all the counters for a given object+instance pair on a single line, using less data and being more searchable.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174027#M16743</guid>
      <dc:creator>alekksi</dc:creator>
      <dc:date>2014-08-08T09:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174028#M16744</link>
      <description>&lt;P&gt;My solution isn't great, but it does work. Here it is below for anyone that wants:&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;[script://.\bin\splunktest.bat]&lt;BR /&gt;&lt;BR /&gt;
index=default&lt;BR /&gt;&lt;BR /&gt;
interval=60&lt;BR /&gt;&lt;BR /&gt;
sourcetype = splunk_test&lt;BR /&gt;&lt;BR /&gt;
source = splunk_test&lt;BR /&gt;&lt;BR /&gt;
disabled = 0&lt;BR /&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;splunktest.bat&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;@echo off &lt;BR /&gt;&lt;BR /&gt;
set splunktest=%SPLUNK_HOME%\etc\apps\SplunkTest\jars&lt;BR /&gt;&lt;BR /&gt;
cd /d %splunktest%&lt;BR /&gt;&lt;BR /&gt;
java -jar splunktest.jar&lt;BR /&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Edits: Formatting and the like&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:32:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174028#M16744</guid>
      <dc:creator>alekksi</dc:creator>
      <dc:date>2014-08-08T09:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174029#M16745</link>
      <description>&lt;P&gt;Can you provide some details about the data source you are trying to get into Splunk ? Log files ? In flight App data ? Data from some API ? &lt;/P&gt;

&lt;P&gt;The experts on this forum will then be able to advise of the best way to get this data into Splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:33:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174029#M16745</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2014-08-08T09:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using Java app with Splunk - Commands, scripts or modular inputs?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174030#M16746</link>
      <description>&lt;P&gt;In a way, it's kind of irrelevant what my data source is. I have a java app that generates data from a source, then connects via a TCP socket to the local SplunkForwarder, which then forwards data to the collectors.&lt;/P&gt;

&lt;P&gt;As you asked, the datasource is a CSV file generated by Windows Performance Monitor. As this is a messy file, it can't be sent directly to Splunk without formatting the data, also out-of-the-box Splunk PerfMon app is not fit for purpose.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Aug 2014 09:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Using-Java-app-with-Splunk-Commands-scripts-or-modular-inputs/m-p/174030#M16746</guid>
      <dc:creator>alekksi</dc:creator>
      <dc:date>2014-08-08T09:40:28Z</dc:date>
    </item>
  </channel>
</rss>

