<?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 Combine a search and subsearch to create a table with all values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299016#M90120</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;Quick question here: I have the following queries:&lt;/P&gt;

&lt;P&gt;Q1: Sub-Search for userID&lt;BR /&gt;
Q2: Main search, which provides username and department&lt;/P&gt;

&lt;P&gt;Currently I can get a table with userID, Username &amp;amp; Department.&lt;/P&gt;

&lt;P&gt;I would like to include in the result table each user's last access timestamp, but this field is in the sub-search index. What is the best approach to achieve that?&lt;/P&gt;

&lt;P&gt;Table:&lt;/P&gt;

&lt;P&gt;UserID | Username | Department | Last Access&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Oct 2017 06:54:43 GMT</pubDate>
    <dc:creator>robettinger</dc:creator>
    <dc:date>2017-10-06T06:54:43Z</dc:date>
    <item>
      <title>Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299016#M90120</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;Quick question here: I have the following queries:&lt;/P&gt;

&lt;P&gt;Q1: Sub-Search for userID&lt;BR /&gt;
Q2: Main search, which provides username and department&lt;/P&gt;

&lt;P&gt;Currently I can get a table with userID, Username &amp;amp; Department.&lt;/P&gt;

&lt;P&gt;I would like to include in the result table each user's last access timestamp, but this field is in the sub-search index. What is the best approach to achieve that?&lt;/P&gt;

&lt;P&gt;Table:&lt;/P&gt;

&lt;P&gt;UserID | Username | Department | Last Access&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 06:54:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299016#M90120</guid>
      <dc:creator>robettinger</dc:creator>
      <dc:date>2017-10-06T06:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299017#M90121</link>
      <description>&lt;P&gt;what are you using? Join or append or stats?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:11:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299017#M90121</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2017-10-06T08:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299018#M90122</link>
      <description>&lt;P&gt;I managed to get what I want by using join, it does, take, however, a long time ... maybe there is a more "performant" way to achieve that?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299018#M90122</guid>
      <dc:creator>robettinger</dc:creator>
      <dc:date>2017-10-06T08:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299019#M90123</link>
      <description>&lt;P&gt;have you checked if the same can be achieved using something like |stats values(field)....?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:56:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299019#M90123</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2017-10-06T08:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299020#M90124</link>
      <description>&lt;P&gt;Try this!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(Condition of main and sub search)
|stats earest(Username) as Username,earest(Department) as Department,latest("Last Access") as  Last_Access by UserID

UserID | Username | Department | Last Access
------------------------------- ------------
1 X Y ------------
1 _ _ 2017/10/1
1 X Y ------------
1 X Y ------------
1 _ _ 2017/10/2 ------------
1 _ _ 2017/10/3 ------------
------------------------------- ------------
1 X Y 2017/10/3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 09:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299020#M90124</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-10-06T09:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Combine a search and subsearch to create a table with all values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299021#M90125</link>
      <description>&lt;P&gt;The main issue is the latest event I am looking for is not in the main search index, but the sub-search one ... I ditched the sub-search and performed a join which gives me what I want, but it is very expensive ...&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 11:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-a-search-and-subsearch-to-create-a-table-with-all-values/m-p/299021#M90125</guid>
      <dc:creator>robettinger</dc:creator>
      <dc:date>2017-10-06T11:16:09Z</dc:date>
    </item>
  </channel>
</rss>

