<?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 do divide greater than and less than in splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346961#M102730</link>
    <description>&lt;P&gt;Hey @sagar1905&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... my search | eval divide=case(D&amp;lt;=8000,”Y”,D&amp;gt;8000,”X”) | stats count by divide
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Sun, 17 Dec 2017 00:54:09 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2017-12-17T00:54:09Z</dc:date>
    <item>
      <title>How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346959#M102728</link>
      <description>&lt;P&gt;I'm trying to divide my query into two parts, D&amp;gt;8000 as X and D&amp;lt;=8000 as Y, so i put it .... my search | eval count(if(D&amp;lt;=8000)) AS Y, count(if(D&amp;gt;8000)) AS X | transpose.................... but its not working. How do I divide it?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 18:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346959#M102728</guid>
      <dc:creator>sagar1905</dc:creator>
      <dc:date>2017-12-16T18:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346960#M102729</link>
      <description>&lt;P&gt;What does "it's not working" mean?  What do you get for X and Y?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 23:18:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346960#M102729</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-12-16T23:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346961#M102730</link>
      <description>&lt;P&gt;Hey @sagar1905&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... my search | eval divide=case(D&amp;lt;=8000,”Y”,D&amp;gt;8000,”X”) | stats count by divide
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 00:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346961#M102730</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-17T00:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346962#M102731</link>
      <description>&lt;P&gt;Do you want these as separate fields or as one field with two values? &lt;/P&gt;

&lt;P&gt;To create one field with two values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval two_parts=if(D&amp;lt;=8000,”Y”,”X”)...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get separate fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|eval Y=if(D&amp;lt;=8000,D,null())|eval X=if(D&amp;gt;8000,D,null())...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Dec 2017 04:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346962#M102731</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-12-17T04:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346963#M102732</link>
      <description>&lt;P&gt;The other answers look like they will accomplish what you want, but in terms of the syntax you started with I wonder if you're looking for this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats count(eval(D&amp;lt;=8000)) AS Y, count(eval(D&amp;gt;8000)) AS X
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Dec 2017 04:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346963#M102732</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-17T04:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346964#M102733</link>
      <description>&lt;P&gt;Hey @mayurr98, it didn't work.&lt;BR /&gt;
I got the following error &lt;BR /&gt;
Error in 'eval' command: The expression is malformed. An unexpected character is reached at '”Y”,D&amp;gt;8000,”X”)'.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 23:40:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346964#M102733</guid>
      <dc:creator>sagar1905</dc:creator>
      <dc:date>2017-12-17T23:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346965#M102734</link>
      <description>&lt;P&gt;Thanks micahkemp, this works. So I should have used eval instead of if.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 23:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346965#M102734</guid>
      <dc:creator>sagar1905</dc:creator>
      <dc:date>2017-12-17T23:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do divide greater than and less than in splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346966#M102735</link>
      <description>&lt;P&gt;Try this &lt;BR /&gt;
     .... my search | eval divide=if(D&amp;lt;=8000,”Y”,”X”) | stats count by divide&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 04:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-divide-greater-than-and-less-than-in-splunk/m-p/346966#M102735</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-18T04:46:59Z</dc:date>
    </item>
  </channel>
</rss>

