<?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: How to combine two searches and display as a single table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282788#M85416</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;My search |top 5 users|join users [search My search |stats values(field_1) as field_1 values(field_2) as field_2 by users]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it probably isn't the most efficient way but it should work.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2016 13:27:56 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2016-10-27T13:27:56Z</dc:date>
    <item>
      <title>How to combine two searches and display as a single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282787#M85415</link>
      <description>&lt;P&gt;I have the below search_1 &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;My search |top 5 users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have a second search as below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;My search |stats values(field_1) as field_1 values(field_2) as field_2 by users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now how can I combine these two searches and display a result in tabular chart which contains field_1 and field_2 values of the top 5 users only?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282787#M85415</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T11:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches and display as a single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282788#M85416</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;My search |top 5 users|join users [search My search |stats values(field_1) as field_1 values(field_2) as field_2 by users]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;it probably isn't the most efficient way but it should work.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2016 13:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282788#M85416</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-27T13:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches and display as a single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282789#M85417</link>
      <description>&lt;P&gt;Why not just calculate the top users in your stats command by adding a count since that is what top is doing and then only grab the top 5 from the stats results after you sort it ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... |stats values(field_1) as field_1 values(field_2) as field_2 count by users | sort - count | head 5
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 13:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282789#M85417</guid>
      <dc:creator>MattZerfas</dc:creator>
      <dc:date>2016-10-27T13:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine two searches and display as a single table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282790#M85418</link>
      <description>&lt;P&gt;Use a sub search to collect the top 5 users:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[search My search | top 5 users | fields users] My search |
stats values(field_1) as field_1 values(field_2) as field_2 by users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results from that sub search are OR'd together, something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(users=ABC OR users=DEF OR users=GHI OR users=JKL OR users=MNO) My search ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Oct 2016 13:54:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-two-searches-and-display-as-a-single-table/m-p/282790#M85418</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-10-27T13:54:31Z</dc:date>
    </item>
  </channel>
</rss>

