<?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 Сustom search comand for java in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/%D0%A1ustom-search-comand-for-java/m-p/531722#M9556</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have an example of a custom python script for displaying events from db in the splunk, help with the same example how to do this for Java?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sys, time
from splunklib.searchcommands import \
    dispatch, GeneratingCommand, Configuration, Option, validators

@Configuration()
class GenerateHelloCommand(GeneratingCommand):
    count = Option(require=True, validate=validators.Integer())

    def generate(self):
        for i in range(1, self.count + 1):
            text = 'Hello World %d' % i
            yield {'_time': time.time(), 'event_no': i, '_raw': text }

dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Dec 2020 15:27:11 GMT</pubDate>
    <dc:creator>sangears</dc:creator>
    <dc:date>2020-12-02T15:27:11Z</dc:date>
    <item>
      <title>Сustom search comand for java</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/%D0%A1ustom-search-comand-for-java/m-p/531722#M9556</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have an example of a custom python script for displaying events from db in the splunk, help with the same example how to do this for Java?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;import sys, time
from splunklib.searchcommands import \
    dispatch, GeneratingCommand, Configuration, Option, validators

@Configuration()
class GenerateHelloCommand(GeneratingCommand):
    count = Option(require=True, validate=validators.Integer())

    def generate(self):
        for i in range(1, self.count + 1):
            text = 'Hello World %d' % i
            yield {'_time': time.time(), 'event_no': i, '_raw': text }

dispatch(GenerateHelloCommand, sys.argv, sys.stdin, sys.stdout, __name__) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 15:27:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/%D0%A1ustom-search-comand-for-java/m-p/531722#M9556</guid>
      <dc:creator>sangears</dc:creator>
      <dc:date>2020-12-02T15:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Сustom search comand for java</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/%D0%A1ustom-search-comand-for-java/m-p/531735#M9557</link>
      <description>&lt;P&gt;It doesn't say you can't use Java, but one of the prerequisites at&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/devtools/customsearchcommands/createcustomsearchcmd" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/devtools/customsearchcommands/createcustomsearchcmd&lt;/A&gt;&amp;nbsp;is the Splunk SDK for Python so I conclude you must use Python for custom commands.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 16:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/%D0%A1ustom-search-comand-for-java/m-p/531735#M9557</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-12-02T16:32:12Z</dc:date>
    </item>
  </channel>
</rss>

