<?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: Splunk Query to Generate an n-event sample across sourcetypes in an index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651507#M225229</link>
    <description>&lt;LI-CODE lang="markup"&gt;| fillnull value="NULL" subeventtype
| streamstats count by eventtype subeventtype
| where count &amp;lt; 6&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 21 Jul 2023 15:08:21 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-07-21T15:08:21Z</dc:date>
    <item>
      <title>Splunk Query to Generate an n-event sample across sourcetypes in an index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651504#M225228</link>
      <description>&lt;P&gt;Hi people,&lt;/P&gt;&lt;P&gt;I wonder whether it is possible to run a query that generates a set of&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;n-&lt;/EM&gt;&lt;/STRONG&gt;sample of events for each sourcetype in an index?&lt;/P&gt;&lt;P&gt;In some sense, if the log data has been ingested and conformed properly, this is perhaps not so problematic, you might build a datamodel or just query across the relevant CIM field (alias.)&lt;BR /&gt;&lt;BR /&gt;So lets get specific:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index-someIndex sourcetype=someSourceType
| enumerate against some defined key value, say an eventtype
| enumerate all of the eventtypes and pull out any subeventtypes
| list the for 2-5 events for each subeventtype, else just list the 2-5 events for the the eventtype
| table _time, eventtype, subeventtype (NULL if blank), event&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 14:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651504#M225228</guid>
      <dc:creator>JohnEGones</dc:creator>
      <dc:date>2023-07-21T14:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to Generate an n-event sample across sourcetypes in an index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651507#M225229</link>
      <description>&lt;LI-CODE lang="markup"&gt;| fillnull value="NULL" subeventtype
| streamstats count by eventtype subeventtype
| where count &amp;lt; 6&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 21 Jul 2023 15:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651507#M225229</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-21T15:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to Generate an n-event sample across sourcetypes in an index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651512#M225230</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks. I have not used &lt;STRONG&gt;streamstats&amp;nbsp;&lt;/STRONG&gt; much before.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I suppose there is not really a good way to generalize this; since simpler queries like this already assume your data is fairly well-parsed.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 15:30:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651512#M225230</guid>
      <dc:creator>JohnEGones</dc:creator>
      <dc:date>2023-07-21T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to Generate an n-event sample across sourcetypes in an index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651517#M225234</link>
      <description>&lt;P&gt;Correct, you need at least one field to do the stats by.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jul 2023 16:12:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-Generate-an-n-event-sample-across-sourcetypes-in/m-p/651517#M225234</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-07-21T16:12:55Z</dc:date>
    </item>
  </channel>
</rss>

