<?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: using spl to pick random names from list in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699556#M237476</link>
    <description>&lt;LI-CODE lang="markup"&gt;| eval id=random()
| sort 0 id
| streamstats count as id
| eval group=((id - 1)%5) + 1
| stats list("Display Name") as "Display Name" by group&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 19 Sep 2024 11:12:38 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-09-19T11:12:38Z</dc:date>
    <item>
      <title>using spl to pick random names from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699541#M237467</link>
      <description>&lt;P&gt;Morning All&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to work out how to use splunk spl to pick random names from a list&lt;/P&gt;&lt;P&gt;i have 1 field called 'displayName'. there are over 200 entries and i'd like to use Splunk to pick 5 random names&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;appreciate help in this&lt;/P&gt;&lt;P&gt;Paula&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 10:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699541#M237467</guid>
      <dc:creator>PaulaCom</dc:creator>
      <dc:date>2024-09-19T10:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: using spl to pick random names from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699551#M237472</link>
      <description>&lt;P&gt;If your values are in a multi-value field, you can do something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval choice=mvindex(displayName, random()%200)&lt;/LI-CODE&gt;&lt;P&gt;If the names are in separate events, you could do something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval id=random()%500
| sort 0 id
| head 5&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Sep 2024 11:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699551#M237472</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-19T11:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: using spl to pick random names from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699553#M237474</link>
      <description>&lt;P&gt;i've looked at similar search online and have come up with this&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| table "Display Name"
| eval "group" = (random() % 2) +1
| stats list("Display Name") as "Display Name" by "group"&lt;/LI-CODE&gt;
&lt;P&gt;this is returning random names in two groups&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%"&gt;group&lt;/TD&gt;
&lt;TD width="50%"&gt;display Name&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;joe blogs 5&lt;/P&gt;
&lt;P&gt;joe blogs 2&lt;/P&gt;
&lt;P&gt;joe blogs&amp;nbsp; 6&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;joe blogs 7&lt;/P&gt;
&lt;P&gt;joe blogs 8&lt;/P&gt;
&lt;P&gt;joe blogs&amp;nbsp; 12&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;Any ideas how i can set the number returning for each group? maybe using the limit function???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 17:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699553#M237474</guid>
      <dc:creator>PaulaCom</dc:creator>
      <dc:date>2024-09-19T17:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: using spl to pick random names from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699555#M237475</link>
      <description>&lt;P&gt;thank&amp;nbsp; you the second option works for what i need&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 11:12:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699555#M237475</guid>
      <dc:creator>PaulaCom</dc:creator>
      <dc:date>2024-09-19T11:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: using spl to pick random names from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699556#M237476</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval id=random()
| sort 0 id
| streamstats count as id
| eval group=((id - 1)%5) + 1
| stats list("Display Name") as "Display Name" by group&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Sep 2024 11:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-spl-to-pick-random-names-from-list/m-p/699556#M237476</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-19T11:12:38Z</dc:date>
    </item>
  </channel>
</rss>

