<?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 Search Query Help =( in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21377#M3507</link>
    <description>&lt;P&gt;I am trying to monitor the percentages of 500's per endpoint of my api. I currently am returning all of the information and want to only show results if the percentage goes over 5%. (this way I can alert whenever the report is ran and there are greater than 0 results. &lt;/P&gt;

&lt;P&gt;sourcetype=My_Api_Access_Log&lt;BR /&gt;&lt;BR /&gt;
| eval path=My_Path&lt;BR /&gt;&lt;BR /&gt;
| eval endpoint = method." ".path&lt;BR /&gt;&lt;BR /&gt;
| eval iserror=if(status=500,1,0)&lt;BR /&gt;&lt;BR /&gt;
| eval err_user=if(iserror==1, user_id, null())&lt;BR /&gt;&lt;BR /&gt;
| stats sum(iserror) as errors, count as total, dc(err_user) as users by endpoint&lt;BR /&gt;&lt;BR /&gt;
| where errors != 0&lt;BR /&gt;&lt;BR /&gt;
| eval percent=round(100*errors/total,2)."%"&lt;BR /&gt;&lt;BR /&gt;
| fields endpoint, errors, total, percent, users&lt;BR /&gt;&lt;BR /&gt;
| sort -percent &lt;/P&gt;

&lt;P&gt;This is working great, but when I add:&lt;/P&gt;

&lt;P&gt;| where percent &amp;gt; 5&lt;/P&gt;

&lt;P&gt;I get no results even though I know I have endpoints over 5% error rates. &lt;BR /&gt;
Any ideas?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:28:57 GMT</pubDate>
    <dc:creator>dmw7752</dc:creator>
    <dc:date>2020-09-28T14:28:57Z</dc:date>
    <item>
      <title>Search Query Help =(</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21377#M3507</link>
      <description>&lt;P&gt;I am trying to monitor the percentages of 500's per endpoint of my api. I currently am returning all of the information and want to only show results if the percentage goes over 5%. (this way I can alert whenever the report is ran and there are greater than 0 results. &lt;/P&gt;

&lt;P&gt;sourcetype=My_Api_Access_Log&lt;BR /&gt;&lt;BR /&gt;
| eval path=My_Path&lt;BR /&gt;&lt;BR /&gt;
| eval endpoint = method." ".path&lt;BR /&gt;&lt;BR /&gt;
| eval iserror=if(status=500,1,0)&lt;BR /&gt;&lt;BR /&gt;
| eval err_user=if(iserror==1, user_id, null())&lt;BR /&gt;&lt;BR /&gt;
| stats sum(iserror) as errors, count as total, dc(err_user) as users by endpoint&lt;BR /&gt;&lt;BR /&gt;
| where errors != 0&lt;BR /&gt;&lt;BR /&gt;
| eval percent=round(100*errors/total,2)."%"&lt;BR /&gt;&lt;BR /&gt;
| fields endpoint, errors, total, percent, users&lt;BR /&gt;&lt;BR /&gt;
| sort -percent &lt;/P&gt;

&lt;P&gt;This is working great, but when I add:&lt;/P&gt;

&lt;P&gt;| where percent &amp;gt; 5&lt;/P&gt;

&lt;P&gt;I get no results even though I know I have endpoints over 5% error rates. &lt;BR /&gt;
Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:28:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21377#M3507</guid>
      <dc:creator>dmw7752</dc:creator>
      <dc:date>2020-09-28T14:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Search Query Help =(</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21378#M3508</link>
      <description>&lt;P&gt;When you append the symbol "%" to your percent field, you change it's type from numerical to string. Comparing a string to a numeric value will render no results. This akin to comparing "5%" &amp;gt; 5. &lt;/P&gt;

&lt;P&gt;Change&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | eval percent=round(100*errors/total,2)."%" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval percent=round(100*errors/total,2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And add this to the end of your search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval percent=percent."%"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 Jul 2013 23:02:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21378#M3508</guid>
      <dc:creator>Gilberto_Castil</dc:creator>
      <dc:date>2013-07-31T23:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Search Query Help =(</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21379#M3509</link>
      <description>&lt;P&gt;Oh my God...Im so stupid. Thank you. I cam back to this search after writing it a month ago and forgot I added that for aesthetics. Fresh pair of eyes. You sir, saved my sanity. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://24.media.tumblr.com/022c89f083711e52d47f5dc75db33db6/tumblr_mocdvvCOSs1srujzdo1_500.gif"&gt;http://24.media.tumblr.com/022c89f083711e52d47f5dc75db33db6/tumblr_mocdvvCOSs1srujzdo1_500.gif&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 23:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-Query-Help/m-p/21379#M3509</guid>
      <dc:creator>dmw7752</dc:creator>
      <dc:date>2013-07-31T23:08:44Z</dc:date>
    </item>
  </channel>
</rss>

