<?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 compare multiple sourcetypes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380310#M169719</link>
    <description>&lt;P&gt;If you're only interested in event count, you can use a rather efficient command &lt;CODE&gt;tstats&lt;/CODE&gt; (works on metadata fields e.g. index/host/sourcetype/source etc which you seems to do)&lt;/P&gt;

&lt;P&gt;To get a row for each sourcetype with count of events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index="log" by sourcetype         
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get a column for each sourcetype with count of events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index="log" by index sourcetype   | chart sum(count) by index sourcetype limit=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 02 May 2018 18:23:29 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-05-02T18:23:29Z</dc:date>
    <item>
      <title>How to compare multiple sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380309#M169718</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;In one index I have multiple sourcetypes. I want to be able to compare the values between these sourcetypes, but I do not know where to even start. &lt;/P&gt;

&lt;P&gt;I was trying the following search:&lt;/P&gt;

&lt;P&gt;index="log" &lt;BR /&gt;
| stats count events if(sourcetype="SAT") as SAT&lt;/P&gt;

&lt;P&gt;but this search seems very complicated. I want to be able to do something like:&lt;/P&gt;

&lt;P&gt;|stats count events by sourcetype &lt;/P&gt;

&lt;P&gt;but again, this doesn't work. Help! &lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 18:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380309#M169718</guid>
      <dc:creator>tonahoyos</dc:creator>
      <dc:date>2018-05-02T18:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare multiple sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380310#M169719</link>
      <description>&lt;P&gt;If you're only interested in event count, you can use a rather efficient command &lt;CODE&gt;tstats&lt;/CODE&gt; (works on metadata fields e.g. index/host/sourcetype/source etc which you seems to do)&lt;/P&gt;

&lt;P&gt;To get a row for each sourcetype with count of events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index="log" by sourcetype         
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get a column for each sourcetype with count of events in selected time range&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|tstats count WHERE index="log" by index sourcetype   | chart sum(count) by index sourcetype limit=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 May 2018 18:23:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380310#M169719</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-02T18:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare multiple sourcetypes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380311#M169720</link>
      <description>&lt;P&gt;Perfect! Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 18:43:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-multiple-sourcetypes/m-p/380311#M169720</guid>
      <dc:creator>tonahoyos</dc:creator>
      <dc:date>2018-05-02T18:43:56Z</dc:date>
    </item>
  </channel>
</rss>

