<?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 union results in a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35570#M7816</link>
    <description>&lt;P&gt;I am trying to display in one table a difference from a performance log to a specific service from 2 diffrent times (for example : how much time a service (avg and count) took today vs yesterday) &lt;/P&gt;

&lt;P&gt;I tried using : stats/fields/table but each time my final result is a table where the 1st avg and the 2nd avg are not in the same row&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-3d@d latest=-2d@d | chart avg(lastLap) as avg_time  count  by vo | eval key="1st" | fields vo avg_time count key | append [ search index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-2d@d latest=-1d@d | chart avg(lastLap) as avg_time2  count as count2  by vo | eval key="2nd" | fields vo avg_time2 count2 ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;vo - is the field who display the service name.&lt;/P&gt;

&lt;P&gt;how can i union the avg_time2 and avg_time1 to be in the same row for a certain "vo"&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:34:34 GMT</pubDate>
    <dc:creator>avishayh</dc:creator>
    <dc:date>2020-09-28T14:34:34Z</dc:date>
    <item>
      <title>union results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35570#M7816</link>
      <description>&lt;P&gt;I am trying to display in one table a difference from a performance log to a specific service from 2 diffrent times (for example : how much time a service (avg and count) took today vs yesterday) &lt;/P&gt;

&lt;P&gt;I tried using : stats/fields/table but each time my final result is a table where the 1st avg and the 2nd avg are not in the same row&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-3d@d latest=-2d@d | chart avg(lastLap) as avg_time  count  by vo | eval key="1st" | fields vo avg_time count key | append [ search index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-2d@d latest=-1d@d | chart avg(lastLap) as avg_time2  count as count2  by vo | eval key="2nd" | fields vo avg_time2 count2 ] 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;vo - is the field who display the service name.&lt;/P&gt;

&lt;P&gt;how can i union the avg_time2 and avg_time1 to be in the same row for a certain "vo"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35570#M7816</guid>
      <dc:creator>avishayh</dc:creator>
      <dc:date>2020-09-28T14:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: union results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35571#M7817</link>
      <description>&lt;P&gt;You could use join rather than append.&lt;/P&gt;

&lt;P&gt;index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-3d@d latest=-2d@d | chart avg(lastLap) as avg_time count by vo | eval key="1st" | fields vo avg_time count key | join host [ search index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-2d@d latest=-1d@d | chart avg(lastLap) as avg_time2 count as count2 by vo | eval key="2nd" | fields vo avg_time2 count2 ]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35571#M7817</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2020-09-28T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: union results in a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35572#M7818</link>
      <description>&lt;P&gt;I think you are making this far more complicated than you need to. If I understand you correctly, a simple &lt;CODE&gt;stats&lt;/CODE&gt; (or &lt;CODE&gt;chart&lt;/CODE&gt; or &lt;CODE&gt;timechart&lt;/CODE&gt;)  might do the trick. And avoid &lt;CODE&gt;join&lt;/CODE&gt; - really.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=asindex source=Prod sourcetype=performance vo!=null lastLap&amp;gt;10000 earliest=-3d@d latest=-1d@d | timechart span=1d count avg(lastLap) by vo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;another option might be to use &lt;CODE&gt;chart&lt;/CODE&gt; instead of &lt;CODE&gt;timechart&lt;/CODE&gt;;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | chart count avg(lastLap) over vo by date_mday&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2013 11:18:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/union-results-in-a-table/m-p/35572#M7818</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-15T11:18:13Z</dc:date>
    </item>
  </channel>
</rss>

