<?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: stats count by combine values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655053#M226289</link>
    <description>&lt;P&gt;Split your ip addresses into a multi-value field, gather then up and sum your counts by guid, then join the ip addresses up again into a single string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=split(ip,", ")
| stats values(ip) as ip sum(count) as count by guid
| eval ip=mvjoin(ip,", ")&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 21 Aug 2023 15:30:58 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-21T15:30:58Z</dc:date>
    <item>
      <title>How to create stats count by combine values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655048#M226287</link>
      <description>&lt;P&gt;I have a big query that produces output like this.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="splunk.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26913i1D7D5C6ADB1B4EA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="splunk.png" alt="splunk.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Those rows are guid id, count of occurrences, then ip addresses (they're stored in csv like that in raw data). What I'm attempting to do is basically combine instances of the same guid, sum all occurrences, and then have a column that would be a big csv of ALL ip addresses for the guid. I've tried many things, but not&amp;nbsp; having any luck.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 19:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655048#M226287</guid>
      <dc:creator>mituw16</dc:creator>
      <dc:date>2023-08-21T19:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by combine values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655053#M226289</link>
      <description>&lt;P&gt;Split your ip addresses into a multi-value field, gather then up and sum your counts by guid, then join the ip addresses up again into a single string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=split(ip,", ")
| stats values(ip) as ip sum(count) as count by guid
| eval ip=mvjoin(ip,", ")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 21 Aug 2023 15:30:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655053#M226289</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-21T15:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by combine values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655096#M226303</link>
      <description>&lt;P&gt;This said, I have a suspicion that the "big query" itself uses stats to get that "ip1, ip2, ip3" pattern. &amp;nbsp;If so, you should examine that "big query" and do proper stats from there.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 23:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655096#M226303</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-08-21T23:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by combine values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655168#M226330</link>
      <description>&lt;P&gt;Unfortunately the IPAddresses are logged in that manner (2 addresses with a comma) in the applications themselves. My query didn't combine them like that.&lt;/P&gt;&lt;P&gt;That said, I ended up figuring it out. Used this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;prequery

| stats count(Customer) as CustomerRequests values(IPAddresses) as IPAddresses by Customer

| eval IPAddresses = mvjoin(IPAddresses, ",")

| table Customer, CustomerRequests, IPAddresses

| sort -CustomerRequests&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This produced the desired output of&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;&amp;nbsp;Customer&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Requests&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;IPAddresses&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;lt;guid here&amp;gt;&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;192.168.0.1,192.168.0.2,192.168.0.3,192.168.0.4,...etc&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 12:21:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655168#M226330</guid>
      <dc:creator>mituw16</dc:creator>
      <dc:date>2023-08-22T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by combine values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655181#M226334</link>
      <description>&lt;P&gt;If your ip addresses appear in more than one list, they get duplicated unless you do the split as I suggested.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 13:32:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655181#M226334</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-22T13:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: stats count by combine values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655182#M226335</link>
      <description>&lt;P&gt;oh good point! I hadn't noticed that possibility. Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 13:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-stats-count-by-combine-values/m-p/655182#M226335</guid>
      <dc:creator>mituw16</dc:creator>
      <dc:date>2023-08-22T13:34:10Z</dc:date>
    </item>
  </channel>
</rss>

