<?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: Help grouping eval results by City in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236688#M70321</link>
    <description>&lt;P&gt;Looks what you need is even easier:&lt;/P&gt;

&lt;P&gt;| stats count("Very Short") AS "Very Short", count(Short) AS Short, count(Long) AS Long by Country, City&lt;/P&gt;

&lt;P&gt;With this search it's going to count ocurrences of "Very Short", "Short" and "Long" by Country and City.&lt;BR /&gt;
You can also sum the numbers inside the fields of "Very Short", "Short" and "Long" with the command:&lt;/P&gt;

&lt;P&gt;| stats sum("Very Short") AS "Very Short", sum(Short) AS Short, sum(Long) AS Long by Country, City&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2016 14:42:39 GMT</pubDate>
    <dc:creator>gfreitas</dc:creator>
    <dc:date>2016-07-05T14:42:39Z</dc:date>
    <item>
      <title>Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236682#M70315</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My current query is&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats earliest(_time) as first_login latest(_time) as last_login by IP_address User   &lt;BR /&gt;
| eval term=last_login-first_login   &lt;BR /&gt;
| eval term=case(term&amp;lt;86400, "Very Short", term&amp;gt;86400 AND term&amp;lt;(86400*7), "Short", term&amp;gt;(86400*7), "Long") &lt;BR /&gt;
| chart dc(User) as usercount by IP_address,term&lt;BR /&gt;
| iplocation IP_address  &lt;BR /&gt;
| dedup City&lt;BR /&gt;
| where (isnotnull(Country) AND isnotnull(City) AND NOT Country="United States" AND trim(Country)!="" AND trim(City)!="")&lt;BR /&gt;
| table Country City "Very Short" Short Long&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;when i run the query without &lt;CODE&gt;dedup City&lt;/CODE&gt; it lists off every event for each city which is a ton of data and can't be read easily. I'm afraid when I use the dedup, its completely getting rid of the values for some of the City's term results.&lt;/P&gt;

&lt;P&gt;is there a way to do this? I was thinking it might be easier to just create a summary index with the first half of my report, and then possibly i could just do some sort of stats cmd to count the City results by term or something like that...i'm relatively new to splunk.&lt;/P&gt;

&lt;P&gt;if any of my description is confusing i'd be more than happy to try and clarify further.&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 17:31:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236682#M70315</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-07-01T17:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236683#M70316</link>
      <description>&lt;P&gt;Instead of using "| table Country CIty "Very Shot" Shot Long" use the command: " | stats values ("Very Short") AS "Very Short", values(Short) AS Short, values(Long) AS Long by Country, City&lt;/P&gt;

&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 19:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236683#M70316</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2016-07-01T19:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236684#M70317</link>
      <description>&lt;P&gt;Thanks, this does help! (I think)&lt;/P&gt;

&lt;P&gt;Do i need to leave the dedup City in there?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 19:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236684#M70317</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-07-01T19:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236685#M70318</link>
      <description>&lt;P&gt;No, you can delete this dedup from the search&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2016 20:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236685#M70318</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2016-07-01T20:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236686#M70319</link>
      <description>&lt;P&gt;Now its showing different amounts of the values under each Term?&lt;/P&gt;

&lt;P&gt;For example: &lt;/P&gt;

&lt;P&gt;Country                  City             Very Short&lt;BR /&gt;
United Kingdom | Ashford | 11&lt;BR /&gt;
                                                     2&lt;BR /&gt;
                                                     3&lt;/P&gt;

&lt;P&gt;Instead i need it to display the total of each term's logins so it'd say 16 instead of those 3 separately.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 13:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236686#M70319</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-07-05T13:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236687#M70320</link>
      <description>&lt;P&gt;Replace Table command with the following...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval cc=Country."#".City | chart count over cc by term | rex field=cc "(?&amp;lt;County&amp;gt;[^#]+)#(?&amp;lt;City&amp;gt;.*)" | fields - cc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jul 2016 13:22:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236687#M70320</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-05T13:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236688#M70321</link>
      <description>&lt;P&gt;Looks what you need is even easier:&lt;/P&gt;

&lt;P&gt;| stats count("Very Short") AS "Very Short", count(Short) AS Short, count(Long) AS Long by Country, City&lt;/P&gt;

&lt;P&gt;With this search it's going to count ocurrences of "Very Short", "Short" and "Long" by Country and City.&lt;BR /&gt;
You can also sum the numbers inside the fields of "Very Short", "Short" and "Long" with the command:&lt;/P&gt;

&lt;P&gt;| stats sum("Very Short") AS "Very Short", sum(Short) AS Short, sum(Long) AS Long by Country, City&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 14:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236688#M70321</guid>
      <dc:creator>gfreitas</dc:creator>
      <dc:date>2016-07-05T14:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help grouping eval results by City</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236689#M70322</link>
      <description>&lt;P&gt;I tried it with the count() and it shows the same results for each column (VS/S/L), so I tried it with the sum myself earlier and I think that produced what I was looking for.&lt;/P&gt;

&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 16:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-grouping-eval-results-by-City/m-p/236689#M70322</guid>
      <dc:creator>zsizemore</dc:creator>
      <dc:date>2016-07-05T16:53:20Z</dc:date>
    </item>
  </channel>
</rss>

