<?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: How to split the call based on TimeTaken in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572571#M199556</link>
    <description>&lt;P&gt;Error in stats command: eval is invalid&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2021 02:46:49 GMT</pubDate>
    <dc:creator>marinewcreater</dc:creator>
    <dc:date>2021-10-27T02:46:49Z</dc:date>
    <item>
      <title>How to split the call based on TimeTaken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572553#M199550</link>
      <description>&lt;P&gt;I would like to create a Pie chart to show how many calls took less than 100ms, 200ms, and 300ms.&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=star env=prod |search time &amp;gt; 100 | stats count by time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I append &amp;gt; 200 and &amp;gt;300 in the same query?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 23:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572553#M199550</guid>
      <dc:creator>marinewcreater</dc:creator>
      <dc:date>2021-10-26T23:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the call based on TimeTaken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572560#M199552</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=star env=prod | 
chart count(eval(time &amp;lt;100)) AS "&amp;lt;100ms", count(eval(time &amp;gt;100 AND time &amp;lt;200)) AS "&amp;lt;200ms", count(eval(time &amp;gt;200 AND time &amp;lt;300)) AS "&amp;lt;300ms" 
| stats count by time &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;try that query and select pie chart under visualizations.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 23:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572560#M199552</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2021-10-26T23:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the call based on TimeTaken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572561#M199553</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/30875"&gt;@marinewcreater&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could try stats with eval something like this , grouping them by time does not create a great pie chart you could still try it depends on number of data points, use | bin to bucket them before using by time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=star env=prod | searchTime &amp;gt; 100 | stats count(eval(searchTime&amp;gt;100)) as gt_100, count(eval(searchTime&amp;gt;200 AND searchTime&amp;lt;300)) as gt_200, count(eval(searchTime&amp;gt;300)) as gt_300 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 23:57:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572561#M199553</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-10-26T23:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the call based on TimeTaken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572571#M199556</link>
      <description>&lt;P&gt;Error in stats command: eval is invalid&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 02:46:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572571#M199556</guid>
      <dc:creator>marinewcreater</dc:creator>
      <dc:date>2021-10-27T02:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to split the call based on TimeTaken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572578#M199560</link>
      <description>&lt;P&gt;In addition to the `count(eval())` options with stats as have already been suggested, another option would be to create a field that classifies your events by the durations you're interested in... then stats count by that new field...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;If you have the specific ranges that you're interested in...you could use&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/eval" target="_self"&gt;eval&lt;/A&gt;&amp;nbsp;to construct a classifier, and then stats count by that classifier.&lt;/P&gt;&lt;PRE&gt;&amp;lt;base search&amp;gt; &lt;BR /&gt;| eval classifier=case(time&amp;lt;100, "&amp;lt;100", time&amp;lt;200, "&amp;lt;200", time&amp;lt;300, "&amp;lt;300", true(), "&amp;gt;=300" )&lt;BR /&gt;| stats count by classifier&lt;/PRE&gt;&lt;P&gt;Since you have a numeric field, you could use &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/bin" target="_self"&gt;bin&lt;/A&gt; to make those classifiers instead:&lt;/P&gt;&lt;PRE&gt;&amp;lt;base search&amp;gt; &lt;BR /&gt;| bin time as classifier span=100 &lt;BR /&gt;| stats count by classifier&lt;/PRE&gt;&lt;P&gt;And of course there are many other methods of creating a classifier field (single or multi-valued), but the&amp;nbsp;downside to doing a simple by clause is of course is that if you don't have a particular expected range/classifier in your data, you simply won't have that particular range in your output, which depending on your use case may be alright, or may be a problem.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 05:21:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-the-call-based-on-TimeTaken/m-p/572578#M199560</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2021-10-27T05:21:45Z</dc:date>
    </item>
  </channel>
</rss>

