<?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: Stats multiple sourcetypes showing unique field question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573224#M199781</link>
    <description>&lt;P&gt;Adding 'as date' in the stats allowed mvexpand to expand across the different sourcetypes, very nice.&lt;/P&gt;&lt;P&gt;Thanks for highlighting it; let me work with it some more and I'll Karma up.&lt;/P&gt;</description>
    <pubDate>Mon, 01 Nov 2021 19:03:41 GMT</pubDate>
    <dc:creator>PPrice</dc:creator>
    <dc:date>2021-11-01T19:03:41Z</dc:date>
    <item>
      <title>Stats multiple sourcetypes showing unique field question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573107#M199759</link>
      <description>&lt;P&gt;I'm trying to use a key across three sourcetypes to show unique non-multivalue rows using a stats by clause that has a different field in each of the sourcetypes&lt;BR /&gt;i.e.&lt;BR /&gt;&lt;SPAN&gt;Sourcetype A&lt;BR /&gt;&lt;/SPAN&gt;NumberA(Key) Date (by clause)&lt;/P&gt;&lt;P&gt;Sourcetype B&lt;BR /&gt;NumberB(Key) Username (by clause)&lt;/P&gt;&lt;P&gt;Sourcetype C&lt;BR /&gt;NumberC(Key) Version (by clause)&lt;/P&gt;&lt;P&gt;if you use the number field, which is the key across the sourcetypes, as the stats by clause and add the different sourcetype fields as values, it produces multivalue fields (e.g. a number may have multiple dates, or users), where I'm looking for unique rows to show number, Date, Username, Version&lt;BR /&gt;e.g.&lt;BR /&gt;sourcetype=A OR sourcetype=B OR sourcetype=C&lt;BR /&gt;eval number=coalesce(NumberA, NumberB, NumberC)&lt;BR /&gt;stats values(sourcetype) values(Date) values(Username) values(Version) by number&lt;/P&gt;&lt;P&gt;I would have thought that you could add the different fields to the stats by clause after the key, but it's not returning anything-&lt;BR /&gt;e.g.&lt;BR /&gt;sourcetype=A OR sourcetype=B OR sourcetype=C&lt;BR /&gt;eval number=coalesce(NumberA, NumberB, NumberC)&lt;BR /&gt;stats values(sourcetype) by number Date Username Version&lt;/P&gt;&lt;P&gt;Would this make sense, and is possible?&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 00:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573107#M199759</guid>
      <dc:creator>PPrice</dc:creator>
      <dc:date>2021-11-01T00:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Stats multiple sourcetypes showing unique field question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573115#M199762</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/234604"&gt;@PPrice&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per my understanding,&lt;/P&gt;&lt;P&gt;You can use "mvexpand" and "dedup" commands in search to get unique results in rows.&lt;/P&gt;&lt;P&gt;I tried this,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vhharanpositka_0-1635736467752.png" style="width: 628px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16684i441A275F427DEF19/image-dimensions/628x159?v=v2" width="628" height="159" role="button" title="vhharanpositka_0-1635736467752.png" alt="vhharanpositka_0-1635736467752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 03:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573115#M199762</guid>
      <dc:creator>vhharanpositka</dc:creator>
      <dc:date>2021-11-01T03:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Stats multiple sourcetypes showing unique field question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573145#M199771</link>
      <description>&lt;P&gt;The mvexpand didn't seem to work.&lt;/P&gt;&lt;P&gt;I'm trying to produce something like this that contains a unique row that has fields in all three Sourcetypes.&lt;/P&gt;&lt;TABLE width="421"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="105.859px"&gt;Sourcetype&lt;/TD&gt;&lt;TD width="105.766px"&gt;number (From all sourcetypes)&lt;/TD&gt;&lt;TD width="110.625px"&gt;Date (from SourcetypeA)&lt;/TD&gt;&lt;TD width="84.8125px"&gt;Username (from SourcetypeB)&lt;/TD&gt;&lt;TD width="64.6875px"&gt;Version (from SourcetypeC)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="105.859px"&gt;SourcetypeA&lt;BR /&gt;SourcetypeB&lt;BR /&gt;SourcetypeC&lt;/TD&gt;&lt;TD width="105.766px"&gt;12345&lt;/TD&gt;&lt;TD width="110.625px"&gt;12/12/2021&lt;/TD&gt;&lt;TD width="84.8125px"&gt;Fred&lt;/TD&gt;&lt;TD width="64.6875px"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="105.859px"&gt;SourcetypeA&lt;BR /&gt;SourcetypeB&lt;BR /&gt;SourcetypeC&lt;/TD&gt;&lt;TD width="105.766px"&gt;12345&lt;/TD&gt;&lt;TD width="110.625px"&gt;13/12/2021&lt;/TD&gt;&lt;TD width="84.8125px"&gt;Fred&lt;/TD&gt;&lt;TD width="64.6875px"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="105.859px"&gt;SourcetypeA&lt;BR /&gt;SourcetypeB&lt;BR /&gt;SourcetypeC&lt;/TD&gt;&lt;TD width="105.766px"&gt;12345&lt;/TD&gt;&lt;TD width="110.625px"&gt;14/12/2021&lt;/TD&gt;&lt;TD width="84.8125px"&gt;Fred&lt;/TD&gt;&lt;TD width="64.6875px"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;Stats values(sourcetype) values(Username) values(Version) by number,Date&lt;/EM&gt;&lt;BR /&gt;I see these values returned-&lt;/P&gt;&lt;TABLE width="421"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="158"&gt;Sourcetype&lt;/TD&gt;&lt;TD width="64"&gt;number(From all sourcetypes)&lt;/TD&gt;&lt;TD width="71"&gt;Date (from SourcetypeA)&lt;/TD&gt;&lt;TD width="64"&gt;Username (from SourcetypeB)&lt;/TD&gt;&lt;TD width="64"&gt;Version&amp;nbsp;(from SourcetypeC)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SourcetypeA&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD width="71"&gt;12/12/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SourcetypeA&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;13/12/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SourcetypeA&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;14/12/2021&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SourcetypeB&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Fred&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SourcetypeC&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put&lt;BR /&gt;&amp;nbsp; &lt;EM&gt;Stats values(sourcetype) values(Date) values(Username) values(Version)&amp;nbsp; by number&lt;/EM&gt;&lt;BR /&gt;I see these values returned&lt;/P&gt;&lt;TABLE width="775"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="82"&gt;Sourcetype&lt;/TD&gt;&lt;TD width="184"&gt;number(From all sourcetypes)&lt;/TD&gt;&lt;TD width="153"&gt;Date (from SourcetypeA)&lt;/TD&gt;&lt;TD width="186"&gt;Username (from SourcetypeB)&lt;/TD&gt;&lt;TD width="170"&gt;Version&amp;nbsp;(from SourcetypeC)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="82"&gt;SourcetypeA&lt;BR /&gt;SourcetypeB&lt;BR /&gt;SourcetypeC&lt;/TD&gt;&lt;TD&gt;12345&lt;/TD&gt;&lt;TD width="153"&gt;12/12/2021&lt;BR /&gt;13/12/2021&lt;BR /&gt;14/12/2021&lt;/TD&gt;&lt;TD&gt;Fred&lt;/TD&gt;&lt;TD width="170"&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 12:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573145#M199771</guid>
      <dc:creator>PPrice</dc:creator>
      <dc:date>2021-11-01T12:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stats multiple sourcetypes showing unique field question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573183#M199777</link>
      <description>&lt;LI-CODE lang="markup"&gt;Stats values(sourcetype) values(Date) as date values(Username) values(Version)  by number
|mvexpand date&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Nov 2021 15:16:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573183#M199777</guid>
      <dc:creator>tread_splunk</dc:creator>
      <dc:date>2021-11-01T15:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Stats multiple sourcetypes showing unique field question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573224#M199781</link>
      <description>&lt;P&gt;Adding 'as date' in the stats allowed mvexpand to expand across the different sourcetypes, very nice.&lt;/P&gt;&lt;P&gt;Thanks for highlighting it; let me work with it some more and I'll Karma up.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Nov 2021 19:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-multiple-sourcetypes-showing-unique-field-question/m-p/573224#M199781</guid>
      <dc:creator>PPrice</dc:creator>
      <dc:date>2021-11-01T19:03:41Z</dc:date>
    </item>
  </channel>
</rss>

