<?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 create a table with two stats list columns? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112770#M29646</link>
    <description>&lt;P&gt;Perfect.. ~Thanks very much&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2015 15:38:18 GMT</pubDate>
    <dc:creator>stephenlclarke</dc:creator>
    <dc:date>2015-07-10T15:38:18Z</dc:date>
    <item>
      <title>How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112765#M29641</link>
      <description>&lt;P&gt;I have two queries that I want to merge into one.&lt;/P&gt;

&lt;P&gt;First query:&lt;/P&gt;

&lt;P&gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;
sourcetype="sourceType1"&lt;BR /&gt;
    rex "Application=(?&lt;APPNAME&gt;+)" |&lt;BR /&gt;
    dedup appname |&lt;BR /&gt;
    sort appname |&lt;BR /&gt;
    stats list(appname) Column1 by host&lt;BR /&gt;
&amp;lt;/pre&amp;gt;&lt;/APPNAME&gt;&lt;/P&gt;

&lt;P&gt;Returns:&lt;/P&gt;

&lt;P&gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;
host     Column1&lt;BR /&gt;
srv16    APP1&lt;BR /&gt;
         APP2&lt;BR /&gt;
srv19    APP3&lt;BR /&gt;
         APP4&lt;BR /&gt;
srv26    APP5&lt;BR /&gt;
         APP6&lt;BR /&gt;
srv27    APP7&lt;BR /&gt;
         APP8&lt;BR /&gt;
&amp;lt;/pre&amp;gt; &lt;/P&gt;

&lt;P&gt;Second query:&lt;/P&gt;

&lt;P&gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;
sourcetype="sourceType2"&lt;BR /&gt;
    rex "Application=(?&lt;APPNAME&gt;+)" |&lt;BR /&gt;
    dedup appname |&lt;BR /&gt;
    sort appname |&lt;BR /&gt;
    stats list(appname) Column2 by host&lt;BR /&gt;
&amp;lt;/pre&amp;gt;&lt;/APPNAME&gt;&lt;/P&gt;

&lt;P&gt;Returns:&lt;/P&gt;

&lt;P&gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;
host     Column2&lt;BR /&gt;
srv15    APP1&lt;BR /&gt;
         APP2&lt;BR /&gt;
srv16    APP1&lt;BR /&gt;
         APP2&lt;BR /&gt;
srv19    APP3&lt;BR /&gt;
         APP4&lt;BR /&gt;
srv26    APP5&lt;BR /&gt;
         APP6&lt;BR /&gt;
srv27    APP7&lt;BR /&gt;
         APP8&lt;BR /&gt;
&amp;lt;/pre&amp;gt; &lt;/P&gt;

&lt;P&gt;How do I merge these two queries to get something that looks like this:&lt;/P&gt;

&lt;P&gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;
host     Column1 Column2&lt;BR /&gt;
srv15            APP1&lt;BR /&gt;
                 APP2&lt;BR /&gt;
srv16    APP1    APP3&lt;BR /&gt;
         APP2    APP4&lt;BR /&gt;
srv19    APP3&lt;BR /&gt;
         APP4&lt;BR /&gt;
srv25            APP5&lt;BR /&gt;
                 APP6&lt;BR /&gt;
srv26    APP5&lt;BR /&gt;
         APP6&lt;BR /&gt;
srv27    APP7    APP7&lt;BR /&gt;
         APP8    APP8&lt;BR /&gt;
&amp;lt;/pre&amp;gt; &lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 11:34:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112765#M29641</guid>
      <dc:creator>stephenlclarke</dc:creator>
      <dc:date>2015-07-10T11:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112766#M29642</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="sourceType1" OR sourcetype="sourceType2" | rex "Application=(?+)" | stats values(appname) by host sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You don't need the &lt;CODE&gt;sort&lt;/CODE&gt; because &lt;CODE&gt;values&lt;/CODE&gt; sorts automatically.  With &lt;CODE&gt;values&lt;/CODE&gt; you don't need the &lt;CODE&gt;dedup&lt;/CODE&gt; either.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 14:03:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112766#M29642</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-10T14:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112767#M29643</link>
      <description>&lt;P&gt;Update:&lt;/P&gt;

&lt;P&gt;I have a server estate that is running both DEV and TEST instances of a number of applications. One source type has all the logs for the DEV instances and the other has all the logs for the TEST instances.&lt;/P&gt;

&lt;P&gt;What I need is a report that lists all the DEV instances per host in one column and all the TEST instances per host in a separate column. Some hosts will only have DEV while other will only have TEST apps, but a handful will be running both DEV and TEST.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 14:38:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112767#M29643</guid>
      <dc:creator>stephenlclarke</dc:creator>
      <dc:date>2015-07-10T14:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112768#M29644</link>
      <description>&lt;P&gt;Even with your "update", my answer should still give you what you desire, but doubled-up in rows instead of in separate columns.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112768#M29644</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-10T15:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112769#M29645</link>
      <description>&lt;P&gt;To get the columns the way you like, use &lt;CODE&gt;chart&lt;/CODE&gt; instead of &lt;CODE&gt;stats&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype="sourceType1" OR sourcetype="sourceType2" | rex "Application=(?+)" | chart values(appname) by host sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112769#M29645</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-10T15:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a table with two stats list columns?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112770#M29646</link>
      <description>&lt;P&gt;Perfect.. ~Thanks very much&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-table-with-two-stats-list-columns/m-p/112770#M29646</guid>
      <dc:creator>stephenlclarke</dc:creator>
      <dc:date>2015-07-10T15:38:18Z</dc:date>
    </item>
  </channel>
</rss>

