<?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: Count each Item of a multivalue table field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296956#M89579</link>
    <description>&lt;P&gt;Hi hypePG,&lt;BR /&gt;
if you want to filter the total number of IPs you have to add &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats sum(count) AS Total by host | where Total&amp;gt;X
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;before the table command.&lt;BR /&gt;
If instead you want to filter the total number of IPs for each domain you have to add &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where count&amp;gt;X 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after the first stats command.&lt;/P&gt;

&lt;P&gt;The logic of my search is the following:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;at first, I count the occurrences for IP and domains;&lt;/LI&gt;
&lt;LI&gt;I need to insert the eval command because otherwise the order of domain and count fields in the following stats command is different and the only way is to correlate them with eval command;&lt;/LI&gt;
&lt;LI&gt;after I can show all the domains values for each IP;&lt;/LI&gt;
&lt;LI&gt;using rex command, I can extract the count value;&lt;/LI&gt;
&lt;LI&gt;so I can show results.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I hope to be as possible clear!&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2017 15:19:59 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-03-29T15:19:59Z</dc:date>
    <item>
      <title>Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296949#M89572</link>
      <description>&lt;P&gt;Hey everybody,&lt;/P&gt;

&lt;P&gt;I got a search in which I'll try to visualize who many calls from an IP a calling a specific URL.&lt;BR /&gt;
The stats part of my search is kind of easy at the moment and looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename client_host as SourceIP 
| stats values(domain) as Domains count by SourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It gets me a table like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SourceIP     Domains            counts
127.0.0.1     &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt;     12
              &lt;A href="https://community.splunk.com/www.reddit.com" target="test_blank"&gt;www.reddit.com&lt;/A&gt;
127.0.0.2     &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt;      6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The count in the last column only gives me the total amount of calls on all domain the IP called. How do i get a unique value for each domain the IP Adresse called? I tried it on another way, but only could make this work where a single IP had only a single Domain and this was kind of ugly... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;

&lt;P&gt;Max&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 07:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296949#M89572</guid>
      <dc:creator>hypePG</dc:creator>
      <dc:date>2017-03-29T07:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296950#M89573</link>
      <description>&lt;P&gt;Hi hypePG&lt;BR /&gt;
try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| stats count by client_host domain
| rename client_host as SourceIP domain AS Domains
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 07:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296950#M89573</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-29T07:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296951#M89574</link>
      <description>&lt;P&gt;Hey Giuseppe,&lt;/P&gt;

&lt;P&gt;thanks for your answer. But unfortunately this doesn't help me with my problem.&lt;BR /&gt;
With this commands I get the following output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SourceIP     Domains            count
  127.0.0.1     &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt;     6
  127.0.0.1     &lt;A href="https://community.splunk.com/www.reddit.com" target="test_blank"&gt;www.reddit.com&lt;/A&gt;      6
  127.0.0.2    &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt;      6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't want a single line for the identical ip.&lt;BR /&gt;
Regards, Max&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 07:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296951#M89574</guid>
      <dc:creator>hypePG</dc:creator>
      <dc:date>2017-03-29T07:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296952#M89575</link>
      <description>&lt;P&gt;@hypePG... following would be one of the ways to show count of SourceIP by Domains&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart count(Domains) over SourceIP by Domains
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart count(Domains) over Domains by SourceIP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Mar 2017 09:06:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296952#M89575</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-03-29T09:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296953#M89576</link>
      <description>&lt;P&gt;Hi hypePG,&lt;BR /&gt;
it's not so easy but try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| stats count by client_host domain
| eval col=domain+" - "+count 
| stats values(col) AS col values(domain) AS domain by client_host 
| rex field=col "[^-]\s-\s(?&amp;lt;count&amp;gt;\d+)" 
| table client_host domain count
| rename client_host as SourceIP domain AS Domains
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 09:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296953#M89576</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-29T09:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296954#M89577</link>
      <description>&lt;P&gt;Hey Giuseppe,&lt;/P&gt;

&lt;P&gt;this works just fine! I had some trouble understanding your steps, but finally i worked it out.&lt;/P&gt;

&lt;P&gt;Thanks alot.&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 13:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296954#M89577</guid>
      <dc:creator>hypePG</dc:creator>
      <dc:date>2017-03-29T13:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296955#M89578</link>
      <description>&lt;P&gt;Hey @cusello,&lt;/P&gt;

&lt;P&gt;I got one further question. I played a little with your search. If i want to add an additional filter, where i only want to see the IP Adresses which have more than "X" requests I added:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | search count&amp;gt;10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But than I am loosing the multivalue displaying for the domains. At the moment i cant explain why...&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Max&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 14:21:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296955#M89578</guid>
      <dc:creator>hypePG</dc:creator>
      <dc:date>2017-03-29T14:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count each Item of a multivalue table field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296956#M89579</link>
      <description>&lt;P&gt;Hi hypePG,&lt;BR /&gt;
if you want to filter the total number of IPs you have to add &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventstats sum(count) AS Total by host | where Total&amp;gt;X
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;before the table command.&lt;BR /&gt;
If instead you want to filter the total number of IPs for each domain you have to add &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where count&amp;gt;X 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;after the first stats command.&lt;/P&gt;

&lt;P&gt;The logic of my search is the following:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;at first, I count the occurrences for IP and domains;&lt;/LI&gt;
&lt;LI&gt;I need to insert the eval command because otherwise the order of domain and count fields in the following stats command is different and the only way is to correlate them with eval command;&lt;/LI&gt;
&lt;LI&gt;after I can show all the domains values for each IP;&lt;/LI&gt;
&lt;LI&gt;using rex command, I can extract the count value;&lt;/LI&gt;
&lt;LI&gt;so I can show results.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I hope to be as possible clear!&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 15:19:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-each-Item-of-a-multivalue-table-field/m-p/296956#M89579</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-03-29T15:19:59Z</dc:date>
    </item>
  </channel>
</rss>

