<?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: Splunk Java SDK is not working based on splunk role/index defined for the user in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388589#M6622</link>
    <description>&lt;P&gt;updated my code. Please have a look.&lt;/P&gt;</description>
    <pubDate>Fri, 11 May 2018 16:12:43 GMT</pubDate>
    <dc:creator>angelinealex</dc:creator>
    <dc:date>2018-05-11T16:12:43Z</dc:date>
    <item>
      <title>Splunk Java SDK is not working based on splunk role/index defined for the user</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388587#M6620</link>
      <description>&lt;P&gt;I am using Splunk Java SDK to fetch data from Splunk index. &lt;/P&gt;

&lt;P&gt;I have the below in my splunk server.&lt;BR /&gt;
&lt;STRONG&gt;User&lt;/STRONG&gt; - Customer_1_User1&lt;BR /&gt;
&lt;STRONG&gt;Role&lt;/STRONG&gt; - customer1_role (which have access to only customer1_index)&lt;BR /&gt;
&lt;STRONG&gt;Saved Search Name&lt;/STRONG&gt; - test_savedsearch&lt;/P&gt;

&lt;P&gt;I am connecting to splunk from the java application (using Splunk Java SDK) using below code snippet&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    loginArgs.setUsername("Customer_1_User1"));             
    loginArgs.setPassword("xxxx"));                 
    loginArgs.setHost("splunkHostName"));                                   
    loginArgs.setPort(8059);
    Service splunkService = Service.connect(loginArgs)

    //Get the earliest and latest time
SavedSearchDispatchArgs savedSearchDispatchArgs = getEarliestAndLatestTime();

SavedSearchCollection savedSearches = splunkService.getSavedSearches();
SavedSearch savedSearch = splunkService.getSavedSearches().get("test_savedsearch");
Job jobSavedSearch = savedSearch.dispatch(savedSearchDispatchArgs);
Map&amp;lt;String, Object&amp;gt; arguments = new HashMap&amp;lt;String, Object&amp;gt;();
arguments.put("count", 0);
InputStream resultsNormalSearch = jobSavedSearch.getResults(arguments);
ResultsReaderXml resultsReaderNormalSearch = new ResultsReaderXml(resultsNormalSearch);

//fetch data from resultsReaderNormalSearch
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I am trying to fetch data from test_savedsearch through java its returning 500 records. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;'customer1_index' has 150 records only. Its fetching 150 records properly when I run the saved search in splunk.&lt;/STRONG&gt;  &lt;/P&gt;

&lt;P&gt;Why its fetching all data through java application irrespective of roles/index defined to the user??&lt;/P&gt;

&lt;P&gt;Please help to resolve this issue.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:27:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388587#M6620</guid>
      <dc:creator>angelinealex</dc:creator>
      <dc:date>2020-09-29T19:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Java SDK is not working based on splunk role/index defined for the user</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388588#M6621</link>
      <description>&lt;P&gt;Please add the lines of code where you actually start the search, fetch the results etc. &lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 00:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388588#M6621</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-11T00:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Java SDK is not working based on splunk role/index defined for the user</title>
      <link>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388589#M6622</link>
      <description>&lt;P&gt;updated my code. Please have a look.&lt;/P&gt;</description>
      <pubDate>Fri, 11 May 2018 16:12:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Splunk-Java-SDK-is-not-working-based-on-splunk-role-index/m-p/388589#M6622</guid>
      <dc:creator>angelinealex</dc:creator>
      <dc:date>2018-05-11T16:12:43Z</dc:date>
    </item>
  </channel>
</rss>

