<?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: how do you return lookup fields in search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369309#M108800</link>
    <description>&lt;P&gt;How do I receive lookup values in results from the Java SDK? When I run this query in the GUI, I see my lookup fields in grey as highlighted:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3356i48BBE0B1BFA1F24D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
You can see the Region and Site fields.&lt;BR /&gt;
However, I cannot see these fields in the event result in Java:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3357iE2FFC90712605C9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I added the setEnableLookups to the job arguments:&lt;BR /&gt;
jobargs.setEnableLookups(true);&lt;BR /&gt;
But still, they cannot be found. Am I looking in the wrong place? Do I need to enable something else?&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
    <pubDate>Mon, 14 Aug 2017 22:35:02 GMT</pubDate>
    <dc:creator>scriv</dc:creator>
    <dc:date>2017-08-14T22:35:02Z</dc:date>
    <item>
      <title>Java SDK: how do you return lookup fields in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369309#M108800</link>
      <description>&lt;P&gt;How do I receive lookup values in results from the Java SDK? When I run this query in the GUI, I see my lookup fields in grey as highlighted:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3356i48BBE0B1BFA1F24D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
You can see the Region and Site fields.&lt;BR /&gt;
However, I cannot see these fields in the event result in Java:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3357iE2FFC90712605C9D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I added the setEnableLookups to the job arguments:&lt;BR /&gt;
jobargs.setEnableLookups(true);&lt;BR /&gt;
But still, they cannot be found. Am I looking in the wrong place? Do I need to enable something else?&lt;BR /&gt;
Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2017 22:35:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369309#M108800</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-14T22:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK: how do you return lookup fields in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369310#M108801</link>
      <description>&lt;P&gt;I believe what you're seeing is due to &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.1/Knowledge/WhenSplunkEnterpriseaddsfields#Field_extraction_at_search_time"&gt;Field Discovery&lt;/A&gt; -- search will show you fields that wouldn't be auto-extracted when you use lower-level query APIs.  If you specifically request the fields you're looking for by name, It Should Just Work™! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 19:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369310#M108801</guid>
      <dc:creator>acruise_splunk</dc:creator>
      <dc:date>2017-08-22T19:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK: how do you return lookup fields in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369311#M108802</link>
      <description>&lt;P&gt;There are a few routes here to take.&lt;/P&gt;

&lt;P&gt;As @acruise mentions, you can &lt;CODE&gt;|table Region Site *&lt;/CODE&gt; to explicitly declare the fields within the search.&lt;/P&gt;

&lt;P&gt;You may also be experiencing a permissions issue with the lookups being in a different app context then where the search is being run. Check permissions, or use a different namespace in the JAVA.&lt;/P&gt;

&lt;P&gt;Thirdly, You can try setting a &lt;CODE&gt;jobArg&lt;/CODE&gt; with required fields. As documented, the events should return the fields, whether they are used or not. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;jobArgs.setRequiredFieldList(java.lang.String[] requiredFieldList)
Sets one or more required fields to the search. These fields, even if not referenced or used directly by the search, are still included by the events and summary endpoints. Splunk Web uses these fields to prepopulate panels in the Search view.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.0/index.html?com/splunk/JobArgs.html" target="test_blank"&gt;http://docs.splunk.com/DocumentationStatic/JavaSDK/1.6.0/index.html?com/splunk/JobArgs.html&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 19:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369311#M108802</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2017-08-22T19:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK: how do you return lookup fields in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369312#M108803</link>
      <description>&lt;P&gt;Thanks @acruise. I added my response to alacercogitatus's Answer&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 12:29:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369312#M108803</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-23T12:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK: how do you return lookup fields in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369313#M108804</link>
      <description>&lt;P&gt;Thanks for these tips. I eventually found the problem, and as you pointed out, it was to do with permissions. I had already set the permissions for the Lookup Table File &lt;EM&gt;and&lt;/EM&gt; the definition to Global everyone, but, it turned out that I also needed to set this permission for the Automatic Lookup setting, as well! It's working perfectly now - thanks so much. And thanks @acruise, too!&lt;/P&gt;

&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 12:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Java-SDK-how-do-you-return-lookup-fields-in-search-results/m-p/369313#M108804</guid>
      <dc:creator>scriv</dc:creator>
      <dc:date>2017-08-23T12:40:26Z</dc:date>
    </item>
  </channel>
</rss>

