<?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: Porcentage two values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687119#M234360</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256438"&gt;@Miguel3393&lt;/a&gt;&amp;nbsp;actually if you change that line to&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Error_{Codigo_error}=if(in(Codigo_error, "69", "10001", "11"), 1, null()) &lt;/LI-CODE&gt;&lt;P&gt;i.e. replace the final 0 with null() then you will not get all the extra columns for other Codigo_error values.&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2024 01:15:23 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-05-10T01:15:23Z</dc:date>
    <item>
      <title>Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/686947#M234292</link>
      <description>&lt;P&gt;Since I can get it to show me when the percentage of errors 69 and 10001 is greater than 10, with the following search it doesn't work, you can help me.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index="cdr"
| search "Tipo_Trafico"="*" "Codigo_error"="*"
| stats count(eval(Tipo_Trafico="MT")) AS Total_MT, count(eval(Codigo_error="69")) AS Error_69
| eval P_Error_69=((Error_69*100/Total_MT))

| stats count(eval(Tipo_Trafico="MT")) AS Total_MT, count(eval(Codigo_error="10001")) AS Error_10001
| eval P_Error_10001=((Error_10001*100/Total_MT))

| stats count by P_Error_69, P_Error_10001
| where count&amp;gt;10&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 May 2024 08:20:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/686947#M234292</guid>
      <dc:creator>Miguel3393</dc:creator>
      <dc:date>2024-05-09T08:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/686948#M234293</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="cdr" "Tipo_Trafico"="*" "Codigo_error"="*" 
| eval Error_{Codigo_error}=if(Codigo_error="69" OR Codigo_error="10001", 1, 0)
| stats count(eval(Tipo_Trafico="MT")) AS Total_MT sum(Error_*) as Error_*
| foreach Error_* [ eval Error_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;_P=(('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'*100/Total_MT)), ThresholdExceeded=if(Error_&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;_P &amp;gt; 10, 1, coalesce(ThresholdExceeded, 0)) ] 
| where ThresholdExceeded&amp;gt;0&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 May 2024 03:20:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/686948#M234293</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-09T03:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687096#M234349</link>
      <description>&lt;P&gt;Thanks for the response, it does show info, but it seems that it looks for all errors and not just 10001 and 69.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Miguel3393_0-1715290023752.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/30758i9B09D05B498C014A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Miguel3393_0-1715290023752.png" alt="Miguel3393_0-1715290023752.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and it seems not to respect that it only shows when the percentage is greater than 10.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 21:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687096#M234349</guid>
      <dc:creator>Miguel3393</dc:creator>
      <dc:date>2024-05-09T21:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687111#M234355</link>
      <description>&lt;P&gt;Sorry, I misunderstood, it works correctly.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 00:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687111#M234355</guid>
      <dc:creator>Miguel3393</dc:creator>
      <dc:date>2024-05-10T00:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687114#M234357</link>
      <description>&lt;P&gt;If I wanted to add another error ,example Codigo_error="10001", what would I have to do?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 00:42:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687114#M234357</guid>
      <dc:creator>Miguel3393</dc:creator>
      <dc:date>2024-05-10T00:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687116#M234358</link>
      <description>&lt;P class="lia-align-center"&gt;If I wanted to add another error ,example Codigo_error="11", what would I have to do?&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 00:43:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687116#M234358</guid>
      <dc:creator>Miguel3393</dc:creator>
      <dc:date>2024-05-10T00:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687118#M234359</link>
      <description>&lt;P&gt;OK, if you want to add in more error code use cases, then change this line&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Error_{Codigo_error}=if(Codigo_error="69" OR Codigo_error="10001", 1, 0)&lt;/LI-CODE&gt;&lt;P&gt;Change it like to&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Error_{Codigo_error}=if(in(Codigo_error, "69", "10001", "11"), 1, 0) &lt;/LI-CODE&gt;&lt;P&gt;and add as many as needed&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 01:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687118#M234359</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-10T01:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Porcentage two values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687119#M234360</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256438"&gt;@Miguel3393&lt;/a&gt;&amp;nbsp;actually if you change that line to&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Error_{Codigo_error}=if(in(Codigo_error, "69", "10001", "11"), 1, null()) &lt;/LI-CODE&gt;&lt;P&gt;i.e. replace the final 0 with null() then you will not get all the extra columns for other Codigo_error values.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 01:15:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Porcentage-two-values/m-p/687119#M234360</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-05-10T01:15:23Z</dc:date>
    </item>
  </channel>
</rss>

