<?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: Sourcetype Identification in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582747#M102671</link>
    <description>&lt;P&gt;Hi Jotne,&lt;/P&gt;&lt;P&gt;We see that for all the host it is showing as 0 only, could you please guide me what changes required.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 13:10:07 GMT</pubDate>
    <dc:creator>Sandy</dc:creator>
    <dc:date>2022-01-27T13:10:07Z</dc:date>
    <item>
      <title>Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582742#M102669</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;There is some host which is reporting to Splunk with a different sourcetype. We want to filter all the host which is&amp;nbsp;only reporting for XYZ sourcetype. And host needs to be shown if it's reporting for XYZ sourcetype along with any other sourcetype. could you please help us on this query.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582742#M102669</guid>
      <dc:creator>Sandy</dc:creator>
      <dc:date>2022-01-27T12:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582743#M102670</link>
      <description>&lt;P&gt;Here is what I do:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; your search&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | eval test=if(sourcetype="xyz",1,0)&lt;/P&gt;&lt;P&gt;Then you have a field that is 1 for xyz sourcetype and 0 for all other.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 12:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582743#M102670</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2022-01-27T12:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582747#M102671</link>
      <description>&lt;P&gt;Hi Jotne,&lt;/P&gt;&lt;P&gt;We see that for all the host it is showing as 0 only, could you please guide me what changes required.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582747#M102671</guid>
      <dc:creator>Sandy</dc:creator>
      <dc:date>2022-01-27T13:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582755#M102673</link>
      <description>&lt;P&gt;Let me rephrase this because it's not obvious what you need.&lt;/P&gt;&lt;P&gt;I understand that you have a bunch of hosts (let's say host1, host2, ... hostn) from which you're receiving various events with various sourcetypes.&lt;/P&gt;&lt;P&gt;And you want to know if - for each host - sourcetypes for events from this host include XYZ or not.&lt;/P&gt;&lt;P&gt;So effectively you need a table like&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Host&lt;/TD&gt;&lt;TD width="50%"&gt;Sends XYZ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host1&lt;/TD&gt;&lt;TD width="50%"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;host2&lt;/TD&gt;&lt;TD width="50%"&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;...&lt;/TD&gt;&lt;TD width="50%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;hostn&lt;/TD&gt;&lt;TD width="50%"&gt;no&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so, you might do&lt;/P&gt;&lt;PRE&gt;| tstats values(sourcetype) as sourcetypes where index=* by host&lt;BR /&gt;| eval SendsXYZ=if(sourcetypes="XYZ","Yes,"No")&lt;BR /&gt;| fields - sourcetypes&lt;/PRE&gt;&lt;P&gt;Of course if you want to limit your search to a subset of your indexes, you might edit the index=* condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582755#M102673</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-01-27T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582778#M102685</link>
      <description>&lt;P&gt;Post some example data and how you like the result to be.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 15:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582778#M102685</guid>
      <dc:creator>jotne</dc:creator>
      <dc:date>2022-01-27T15:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582789#M102690</link>
      <description>&lt;P&gt;Pleas find the exact requirement below:&lt;/P&gt;&lt;P&gt;Consider same hosts like (Host1, Host2, Host3) and sourcetypes like (abc, def, xyz) which have a reporting table as below,&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="99px" height="49px"&gt;&lt;P&gt;Host Name&lt;/P&gt;&lt;/TD&gt;&lt;TD width="148px" height="49px"&gt;&lt;P&gt;Sourcetype Reporting&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="99px" height="40px"&gt;&lt;P&gt;Host1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="148px" height="40px"&gt;&lt;P&gt;abc,&amp;nbsp; xyz&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="99px" height="40px"&gt;&lt;P&gt;Host2&lt;/P&gt;&lt;/TD&gt;&lt;TD width="148px" height="40px"&gt;&lt;P&gt;xyz&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="99px" height="40px"&gt;&lt;P&gt;Host3&lt;/P&gt;&lt;/TD&gt;&lt;TD width="148px" height="40px"&gt;&lt;P&gt;abc,&amp;nbsp; def,&amp;nbsp; xyz&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here, as you see, Host1 &amp;amp; Host3 are reporting to other sourcetype as well apart from xyz. I want to filter the host having only xyz as the sourcetype. So, in this case it would be Host2.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 16:38:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582789#M102690</guid>
      <dc:creator>Sandy</dc:creator>
      <dc:date>2022-01-27T16:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582795#M102693</link>
      <description>&lt;P&gt;Ok. So my solution was relatively close. The firsf part was ok. That's how you get the aggregation&lt;/P&gt;&lt;PRE&gt;| tstats values(sourcetype) as sourcetypes where index=* by host&lt;/PRE&gt;&lt;P&gt;This will give you a table very similar to the one you posted.&lt;/P&gt;&lt;P&gt;Now all you need to do is to filter it to only include the ones that have anything else than xyz.&lt;/P&gt;&lt;P&gt;To be fully precise, you want the ones that might include xyz but not as a single value but when you join it with the requirement that there must be a sourcetype for every event (so you won't get empty sourcetypes from the aggregation above), you just need to find those entries which contain a value that is different than xyz.&lt;/P&gt;&lt;PRE&gt;| where sourcetypes!="xyz"&lt;/PRE&gt;&lt;P&gt;Luckily the match for multivalued fields is evaluated on every value from such field and matches if the condition is fulfilled for anymof the values.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 17:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582795#M102693</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-01-27T17:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sourcetype Identification</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582796#M102694</link>
      <description>&lt;P&gt;Then you could try something like this (please check syntax as I haven’t splunk on my hands to check it)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats count values(sourcetype) as sts where index=* AND sourcetype="&amp;lt;your sourcetype&amp;gt;" by host
| where count &amp;gt; 0 AND mvcount(sts) = 1
| fields - count sts&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;r. Ismo&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 17:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Sourcetype-Identification/m-p/582796#M102694</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-01-27T17:10:57Z</dc:date>
    </item>
  </channel>
</rss>

