<?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 send data directly to Splunk (web) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-send-data-directly-to-Splunk-web/m-p/395803#M195972</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I'm attempting to implement a direct connection to Splunk in my Java application so I can send data straight to Splunk without having to go through a forwarder. I've written some psuedocode, I just wanted to check if its correct:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import com.splunk.*;

//Connect to Splunk Service
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername("admin");
loginArgs.setPassword("password");
loginArgs.setHost("localhost");
loginArgs.setPort(8089);
Service service = Service.connect(loginArgs);

Index myIndex = service.getIndexes().get("index_name");
Args eventArgs = new Args();
eventArgs.put("CaseName", caseName);
eventArgs.put("Result", result);
eventArgs.put("Runtime", runtime);
eventArgs.put("Environment", env);
eventArgs.put("postDate", date);

myIndex.submit(eventArgs);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Tom&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 11:19:25 GMT</pubDate>
    <dc:creator>tomspring5000</dc:creator>
    <dc:date>2018-08-08T11:19:25Z</dc:date>
    <item>
      <title>Java SDK send data directly to Splunk (web)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-send-data-directly-to-Splunk-web/m-p/395803#M195972</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I'm attempting to implement a direct connection to Splunk in my Java application so I can send data straight to Splunk without having to go through a forwarder. I've written some psuedocode, I just wanted to check if its correct:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import com.splunk.*;

//Connect to Splunk Service
ServiceArgs loginArgs = new ServiceArgs();
loginArgs.setUsername("admin");
loginArgs.setPassword("password");
loginArgs.setHost("localhost");
loginArgs.setPort(8089);
Service service = Service.connect(loginArgs);

Index myIndex = service.getIndexes().get("index_name");
Args eventArgs = new Args();
eventArgs.put("CaseName", caseName);
eventArgs.put("Result", result);
eventArgs.put("Runtime", runtime);
eventArgs.put("Environment", env);
eventArgs.put("postDate", date);

myIndex.submit(eventArgs);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Tom&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 11:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-send-data-directly-to-Splunk-web/m-p/395803#M195972</guid>
      <dc:creator>tomspring5000</dc:creator>
      <dc:date>2018-08-08T11:19:25Z</dc:date>
    </item>
  </channel>
</rss>

