<?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 What syntax can I use to run a search that sorts varying runtimes? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375145#M110226</link>
    <description>&lt;P&gt;I have data for 1 day where I want to sort it with activity like following manner, total number of records took 0-3 sec , total number of records took 3-4 and goes on. Want to present it in one query.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Aug 2017 12:53:57 GMT</pubDate>
    <dc:creator>JyotiP</dc:creator>
    <dc:date>2017-08-23T12:53:57Z</dc:date>
    <item>
      <title>What syntax can I use to run a search that sorts varying runtimes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375145#M110226</link>
      <description>&lt;P&gt;I have data for 1 day where I want to sort it with activity like following manner, total number of records took 0-3 sec , total number of records took 3-4 and goes on. Want to present it in one query.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 12:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375145#M110226</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-08-23T12:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: What syntax can I use to run a search that sorts varying runtimes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375146#M110227</link>
      <description>&lt;P&gt;Currently I have separate query as follows :&lt;BR /&gt;
query 1 : where Val_value&amp;gt;=0 AND Val_value&amp;lt;=3 | stats count&lt;BR /&gt;
query 2 : where Val_value&amp;gt;=3.1 AND Val_value&amp;lt;=4 | stats count&lt;BR /&gt;
query 3 : where Val_value&amp;gt;=4.1 AND Val_value&amp;lt;=5 | stats count&lt;BR /&gt;
query 4 : where Val_value&amp;gt;=5.1 AND Val_value&amp;lt;=6 | stats count&lt;BR /&gt;
So I want to merge the above request into 1 query. How to do it ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375146#M110227</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2020-09-29T15:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: What syntax can I use to run a search that sorts varying runtimes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375147#M110228</link>
      <description>&lt;P&gt;There are two basic syntaxes you can use (probably a dozen more, but these two demonstrate the top two in use)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query here 
| eval mygroup=case(Val_value&amp;gt;=0 AND Val_value&amp;lt;=3,"0.0 to 3.0", 
    Val_value&amp;gt;3 AND Val_value&amp;lt;=4,"3.0+ to 4.0", 
    Val_value&amp;gt;4 AND Val_value&amp;lt;=5,"4.0+ to 5.0", 
    Val_value&amp;gt;5 AND Val_value&amp;lt;=6,"5.0+ to 6.0", 
    true(),"6.0+")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...then your choice of one of these two...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count by mygroup
| chart count by mygroup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;stats&lt;/CODE&gt; presents one record per value of mygroup, &lt;CODE&gt;chart&lt;/CODE&gt; would present them horizontally.&lt;/P&gt;

&lt;P&gt;... OR  ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query here 
| stats count(eval(Val_value&amp;gt;=0 AND Val_value&amp;lt;=3)) as "0.0 to 3.0",
    count(eval(Val_value&amp;gt;3 AND Val_value&amp;lt;=4)) as "3.0+ to 4.0",
    count(eval(Val_value&amp;gt;4 AND Val_value&amp;lt;=5)) as "4.0+ to 5.0",
    count(eval(Val_value&amp;gt;5 AND Val_value&amp;lt;=6)) as "5.0+ to 6.0",
    count(eval(Val_value&amp;gt;6)) as "6.+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This second version presents them horizontally.  If you wanted to change them to vertically, you could do it the other way, or add this afterward...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval junk=1
 | untable junk mygroup count
 | fields - junk
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Aug 2017 13:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375147#M110228</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-23T13:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: What syntax can I use to run a search that sorts varying runtimes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375148#M110229</link>
      <description>&lt;P&gt;@DalJeanis, thanks for the update, let me try and will post my result&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 15:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375148#M110229</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-08-23T15:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: What syntax can I use to run a search that sorts varying runtimes?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375149#M110230</link>
      <description>&lt;P&gt;@DalJeanis can create a pi chart or graph for the above query ??&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 09:09:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-syntax-can-I-use-to-run-a-search-that-sorts-varying/m-p/375149#M110230</guid>
      <dc:creator>JyotiP</dc:creator>
      <dc:date>2017-08-29T09:09:34Z</dc:date>
    </item>
  </channel>
</rss>

