<?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 Java sdk and search query in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62310#M857</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am new to splunk. I have acquired the SDK and I am trying to run tests to see if I can query our production installation easily.&lt;/P&gt;

&lt;P&gt;I built the splunk java sdk. I am trying to test the examples namely search.jar. I am looking at the code in program.java and trying to send a search string to it. I am having no luck.&lt;/P&gt;

&lt;P&gt;I have have put the authentication username and password in the splunkrc file and this works.&lt;/P&gt;

&lt;P&gt;The search string among various I have tried is &lt;/P&gt;

&lt;P&gt;earliest=-30m sourcetype="xreGuide" 76.26.116.49&lt;/P&gt;

&lt;P&gt;I get error SEarch expression required.&lt;/P&gt;

&lt;P&gt;Can someone please tell me how to simulate the search syntax on the command line to do a simple search.&lt;/P&gt;</description>
    <pubDate>Tue, 29 May 2012 13:00:04 GMT</pubDate>
    <dc:creator>ceziefula</dc:creator>
    <dc:date>2012-05-29T13:00:04Z</dc:date>
    <item>
      <title>Java sdk and search query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62310#M857</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am new to splunk. I have acquired the SDK and I am trying to run tests to see if I can query our production installation easily.&lt;/P&gt;

&lt;P&gt;I built the splunk java sdk. I am trying to test the examples namely search.jar. I am looking at the code in program.java and trying to send a search string to it. I am having no luck.&lt;/P&gt;

&lt;P&gt;I have have put the authentication username and password in the splunkrc file and this works.&lt;/P&gt;

&lt;P&gt;The search string among various I have tried is &lt;/P&gt;

&lt;P&gt;earliest=-30m sourcetype="xreGuide" 76.26.116.49&lt;/P&gt;

&lt;P&gt;I get error SEarch expression required.&lt;/P&gt;

&lt;P&gt;Can someone please tell me how to simulate the search syntax on the command line to do a simple search.&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2012 13:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62310#M857</guid>
      <dc:creator>ceziefula</dc:creator>
      <dc:date>2012-05-29T13:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk and search query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62311#M858</link>
      <description>&lt;P&gt;You'll need the command 'search' at the beginning, and include the search in double quotes as your program argument.  The sample application assumes the first and only non-dashed argument qualifiers ("--") is passed in as the entire search string argument. So this is what you should use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"sourcetype=xreGuide earliest=-1m |stats count by remote_ip"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Command line details below and a couple of examples.  Get it working from command line and you should be fine. Something like this: &lt;/P&gt;

&lt;P&gt;./splunk search "sourcetype=xreGuide earliest=-30m 76.26.116.49"&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CLIsearchsyntax"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CLIsearchsyntax&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The bottom of this page on GitHub has some examples and documentation.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/splunk/splunk-sdk-java"&gt;https://github.com/splunk/splunk-sdk-java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 May 2012 13:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62311#M858</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2012-05-29T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Java sdk and search query</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62312#M859</link>
      <description>&lt;P&gt;There is now an extensive search how-to topic posted on the dev portal. See &lt;A href="http://dev.splunk.com/view/SP-CAAAEHQ"&gt;How to search your data using the Java SDK&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Aug 2012 23:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Java-sdk-and-search-query/m-p/62312#M859</guid>
      <dc:creator>ChrisG</dc:creator>
      <dc:date>2012-08-13T23:41:47Z</dc:date>
    </item>
  </channel>
</rss>

