<?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: Splunk search command- How to get table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617681#M214661</link>
    <description>&lt;P&gt;Hy&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I took a picture to illustrate a bit what I would like to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1..jpg" style="width: 943px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22087i9A33A50C6504E39B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1..jpg" alt="1..jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically I want to do this :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;how many client have made 1 requests ?&lt;/P&gt;
&lt;P&gt;how many client have made 2 requests ?&lt;/P&gt;
&lt;P&gt;how many client have made 3 requests ?&lt;/P&gt;
&lt;P&gt;... so on and so forth ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Take the data in the `count` column and the `clientip` column and sort them with a search so as to answer my questions above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final table should look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="25%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;nb_requests&lt;/TD&gt;
&lt;TD width="25%"&gt;Total_client&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;TD width="25%"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;2&lt;/TD&gt;
&lt;TD width="25%"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;4&lt;/TD&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;7&lt;/TD&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Wed, 19 Oct 2022 14:05:29 GMT</pubDate>
    <dc:creator>dj56</dc:creator>
    <dc:date>2022-10-19T14:05:29Z</dc:date>
    <item>
      <title>Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617540#M214608</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Assuming i have numbers, let's say 1-2-3-4-5-6. And each of those represent&lt;/P&gt;
&lt;TABLE border="1" width="36.000000924775094%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Ip adress&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;number of request&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;method&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.3&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.4&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;4&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.6&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;4&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.7&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;1.1.1.8&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;7&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;get&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's could be the search to get following table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="25%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;number of requests&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;number of IPs that make 'x' requests&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2 (meaning to client has made 1 requests)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;3&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;4&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;6&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;7&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="24px"&gt;8&lt;/TD&gt;
&lt;TD width="25%" height="24px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%" height="25px"&gt;9&lt;/TD&gt;
&lt;TD width="25%" height="25px"&gt;0&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617540#M214608</guid>
      <dc:creator>dj56</dc:creator>
      <dc:date>2022-10-18T17:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617548#M214612</link>
      <description>&lt;P&gt;You need to run stats to count the number of distinct ip address against the "number of requests". Let's assume your fieldnames are "ip address" and "method":&lt;BR /&gt;&lt;BR /&gt;&amp;lt;base_search&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;| stats count as "number of request" by "ip address" method&lt;BR /&gt;&lt;/SPAN&gt;| stats dc("ip address") AS "number of IPs that make requests" BY "number of request" method&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617548#M214612</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-18T16:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617550#M214613</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250456"&gt;@dj56&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can use stats dc to find the number of distinct occerrences for each number of requests.&lt;/P&gt;&lt;P&gt;The main problem is when there isn't any occurrences, so you have to define the max number of occurrences to display.&lt;/P&gt;&lt;P&gt;So you have to define the maxnumber of occurrences, fine in this sample:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 100
| stats dc(source) AS dc BY linecount
| append [ | makeresults count=5 | streamstats count AS linecount | eval dc=0 | fields - _time ]
| stats sum(dc) AS total BY linecount&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;in your case, if the max number of requests is 10, you could have:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| stats dc(ip) AS ip_count BY number_of_requests
| append [ | makeresults count=5 | streamstats count AS number_of_requests | eval ip_count=0 | fields - _time ]
| stats sum(ip_count) AS total BY number_of_requests &lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:24:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617550#M214613</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-18T16:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617681#M214661</link>
      <description>&lt;P&gt;Hy&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I took a picture to illustrate a bit what I would like to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1..jpg" style="width: 943px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22087i9A33A50C6504E39B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1..jpg" alt="1..jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically I want to do this :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;how many client have made 1 requests ?&lt;/P&gt;
&lt;P&gt;how many client have made 2 requests ?&lt;/P&gt;
&lt;P&gt;how many client have made 3 requests ?&lt;/P&gt;
&lt;P&gt;... so on and so forth ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Take the data in the `count` column and the `clientip` column and sort them with a search so as to answer my questions above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The final table should look something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="25%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;nb_requests&lt;/TD&gt;
&lt;TD width="25%"&gt;Total_client&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;TD width="25%"&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;2&lt;/TD&gt;
&lt;TD width="25%"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;4&lt;/TD&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="25%"&gt;7&lt;/TD&gt;
&lt;TD width="25%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617681#M214661</guid>
      <dc:creator>dj56</dc:creator>
      <dc:date>2022-10-19T14:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617686#M214663</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250456"&gt;@dj56&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried my solution adapting it to your need?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 12:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617686#M214663</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-19T12:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617690#M214664</link>
      <description>&lt;P&gt;Oh sorry&lt;/P&gt;&lt;P&gt;Yes i tried but i didn't get what i want. Probably because i don't have i field called "number_of_requests" as that digit result from&amp;nbsp; a search count.&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 12:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617690#M214664</guid>
      <dc:creator>dj56</dc:creator>
      <dc:date>2022-10-19T12:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617703#M214668</link>
      <description>&lt;P&gt;Just add something like:&lt;BR /&gt;| stats count as clientcount by count&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:53:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617703#M214668</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2022-10-19T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617706#M214670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250456"&gt;@dj56&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;tell me if it's all clear for you and please accept one answer for the other people of Communty.&lt;/P&gt;&lt;P&gt;otherwise, please share your search to help you more.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:03:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617706#M214670</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-19T14:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617710#M214673</link>
      <description>&lt;P&gt;Hello boss,&lt;/P&gt;&lt;P&gt;Your tips helped out.&lt;/P&gt;&lt;P&gt;very glad now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617710#M214673</guid>
      <dc:creator>dj56</dc:creator>
      <dc:date>2022-10-19T14:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search command- How to get table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617723#M214678</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250456"&gt;@dj56&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the Contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 16:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-search-command-How-to-get-table/m-p/617723#M214678</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-19T16:10:38Z</dc:date>
    </item>
  </channel>
</rss>

