<?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: how to create splunk custom search command with java ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153657#M43146</link>
    <description>&lt;P&gt;I need those in Java. Even though i convert code i don't have an idea whether it works or not&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2015 10:34:28 GMT</pubDate>
    <dc:creator>kalyani_y</dc:creator>
    <dc:date>2015-08-04T10:34:28Z</dc:date>
    <item>
      <title>how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153651#M43140</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;I am trying to create a new custom search command with java, but I only found stuff related to python. &lt;STRONG&gt;Is it possible to create a custom search command with java?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 05:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153651#M43140</guid>
      <dc:creator>kalyani_y</dc:creator>
      <dc:date>2015-08-04T05:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153652#M43141</link>
      <description>&lt;P&gt;You need to use Splunk Java SDK.  Very good documentation at: &lt;A href="http://dev.splunk.com/view/java-sdk/SP-CAAAEHQ"&gt;Splunk Java SDK documentation&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The core logic being..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;// Create the job
JobArgs jobArgs = new JobArgs();
jobArgs.setEarliestTime("rt-1m");
String mySearch = "search index=_internal";
Job job = service.search(mySearch, jobArgs);
// View the results--a stream of previews--using standard Java classes
JobResultsPreviewArgs previewArgs = new JobResultsPreviewArgs();

    InputStream stream = job.getResultsPreview(previewArgs);
    BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
    while ((line = reader.readLine()) != null) {
        System.out.println(line);
    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2015 08:03:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153652#M43141</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2015-08-04T08:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153653#M43142</link>
      <description>&lt;P&gt;hi koshyk&lt;BR /&gt;
Thnx. i tried that one too but my requirement is i need to process those results and post back to splunk preview  and this search has to work dynamically that means the input has to come from splunk search bar. this entire work has to be done with java&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 08:11:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153653#M43142</guid>
      <dc:creator>kalyani_y</dc:creator>
      <dc:date>2015-08-04T08:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153654#M43143</link>
      <description>&lt;P&gt;don't think i quite understood. Is this what you are trying to do ?&lt;BR /&gt;
 - run search1 &amp;amp; get results of search1&lt;BR /&gt;
 - create search2 with results of search1&lt;/P&gt;

&lt;P&gt;(you said, you got examples in python. if you put that, i might look to convert to java)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 08:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153654#M43143</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2015-08-04T08:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153655#M43144</link>
      <description>&lt;P&gt;I need the following to be converted to java and run in splunk&lt;/P&gt;

&lt;P&gt;Thanks InAdvance&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/AdvancedDev/SearchScripts"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/AdvancedDev/SearchScripts&lt;/A&gt;&lt;/STRONG&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 08:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153655#M43144</guid>
      <dc:creator>kalyani_y</dc:creator>
      <dc:date>2015-08-04T08:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153656#M43145</link>
      <description>&lt;P&gt;that's bit of complex sample in that. &lt;BR /&gt;
But found a simpler example at: &lt;A href="http://blogs.splunk.com/2014/04/14/building-custom-search-commands-in-python-part-i-a-simple-generating-command/"&gt;splunk.blogs&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&lt;A href="https://github.com/splunk/splunk-sdk-python/tree/develop/examples/searchcommands_app" target="test_blank"&gt;https://github.com/splunk/splunk-sdk-python/tree/develop/examples/searchcommands_app&lt;/A&gt;
&lt;A href="https://github.com/splunk/splunk-sdk-python/blob/develop/examples/searchcommands_app/bin/generatehello.py" target="test_blank"&gt;https://github.com/splunk/splunk-sdk-python/blob/develop/examples/searchcommands_app/bin/generatehello.py&lt;/A&gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which you can convert to java&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 09:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153656#M43145</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2015-08-04T09:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153657#M43146</link>
      <description>&lt;P&gt;I need those in Java. Even though i convert code i don't have an idea whether it works or not&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 10:34:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153657#M43146</guid>
      <dc:creator>kalyani_y</dc:creator>
      <dc:date>2015-08-04T10:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153658#M43147</link>
      <description>&lt;P&gt;any luck finding out if you can create custom search commands using Java?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 18:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/153658#M43147</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2016-07-14T18:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to create splunk custom search command with java ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/523779#M147759</link>
      <description>&lt;P&gt;Does anyone know if this is possible. Based on the documentation, I don't think it's possible to create a custom search command in Java. It would have to be done with python&lt;/P&gt;&lt;P&gt;custom command documentation for python:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dev.splunk.com/enterprise/docs/devtools/customsearchcommands/customsearchcmdexamples/" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/devtools/customsearchcommands/customsearchcmdexamples/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I went through the docs for Java and there's nothing in regards to custom commands&lt;/P&gt;&lt;P&gt;&lt;A href="https://dev.splunk.com/enterprise/docs/devtools/java/plugin-eclipse/howtouseeclipse" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/devtools/java/plugin-eclipse/howtouseeclipse&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;splunk employees, can you help confirm?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 18:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-create-splunk-custom-search-command-with-java/m-p/523779#M147759</guid>
      <dc:creator>spammenot66</dc:creator>
      <dc:date>2020-10-08T18:29:45Z</dc:date>
    </item>
  </channel>
</rss>

