<?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: keys with many values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23892#M4308</link>
    <description>&lt;P&gt;This doesn't work.  I've tried a few variations on it with no luck.  I always get "No Results Found", even though I can see lots of unique field-pairs in the logs.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jan 2011 07:23:20 GMT</pubDate>
    <dc:creator>rotten</dc:creator>
    <dc:date>2011-01-11T07:23:20Z</dc:date>
    <item>
      <title>keys with many values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23890#M4306</link>
      <description>&lt;P&gt;Suppose my log entries resembled:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   Rick ate a cheeseburger
   Tony ate a grape
   Rick ate a frenchfry
   Tony ate a grape
   Rick ate a cheeseburger
   Sally ate a salad
   ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I have two fields of interest "name" and "food".&lt;/P&gt;

&lt;P&gt;Now, I'd like to know which user eats the most different kinds of food.&lt;/P&gt;

&lt;P&gt;I believe the associate command can be used to tell me which users are most likely to eat which foods.  What I'd rather find is almost the opposite.  Given a key, how many different (unpredictable) values is it paired with?&lt;/P&gt;

&lt;P&gt;Then I could do things like send an alert "RicksDog ate 7 different kinds of food in the past 24 hours - he's going to be sick!".&lt;/P&gt;

&lt;P&gt;I can easily do this with a script.  I'd like to do it in Splunk, if possible.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2011 05:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23890#M4306</guid>
      <dc:creator>rotten</dc:creator>
      <dc:date>2011-01-11T05:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: keys with many values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23891#M4307</link>
      <description>&lt;P&gt;Assuming that you've extracted "name" and "food", you can search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats dc(food) as food_count values(food) as foods by name | sort - food_count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a sorted list of users by number of food types.&lt;/P&gt;

&lt;P&gt;You can also use "eventstats" to calculate the average number of foods if you're unsatisfied with absolute thresholds (fixed counts or top n).&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2011 05:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23891#M4307</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-01-11T05:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: keys with many values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23892#M4308</link>
      <description>&lt;P&gt;This doesn't work.  I've tried a few variations on it with no luck.  I always get "No Results Found", even though I can see lots of unique field-pairs in the logs.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2011 07:23:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23892#M4308</guid>
      <dc:creator>rotten</dc:creator>
      <dc:date>2011-01-11T07:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: keys with many values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23893#M4309</link>
      <description>&lt;P&gt;You should make sure that both "name" and "food" are in every event being summarized.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2011 07:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23893#M4309</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-01-11T07:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: keys with many values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23894#M4310</link>
      <description>&lt;P&gt;followup - I gave up and wrote a script.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2011 23:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/keys-with-many-values/m-p/23894#M4310</guid>
      <dc:creator>rotten</dc:creator>
      <dc:date>2011-01-20T23:14:39Z</dc:date>
    </item>
  </channel>
</rss>

